feat(observability): implement Metrics Collection Framework (14 metric types with Histogram/Counter/Gauge) #672

Merged
freemo merged 1 commits from feature/m6-metrics-collection-framework into master 2026-03-10 18:16:29 +00:00
Owner

Summary

Implement the structured metrics collection framework covering 14 operational metric types with proper Histogram, Counter, and Gauge semantics.

Changes

  • Domain layer: MetricType enum, MetricDefinition model, METRIC_DEFINITIONS registry, extended MetricCollector with typed factory methods and 14 convenience methods, MetricEntry auto-resolves metric_type
  • Infrastructure layer: MetricsEmitter for structured log emission, metrics_log_processor for structlog integration
  • Configuration: metrics_enabled and metrics_export_prometheus settings, DI container registration
  • Instrumentation: Best-effort metric emission in PlanExecutor for plan_duration and plan_decision_count
  • Testing: 34 Behave BDD scenarios, 8 Robot Framework integration tests, ASV benchmark suite

Validation

  • All 9762 unit test scenarios pass (0 failures)
  • All 8 new Robot integration tests pass
  • pyright strict mode: 0 errors
  • ruff lint: 0 errors
  • Coverage: 99%
  • vulture dead code: clean

Closes #579

## Summary Implement the structured metrics collection framework covering 14 operational metric types with proper Histogram, Counter, and Gauge semantics. ## Changes - **Domain layer**: MetricType enum, MetricDefinition model, METRIC_DEFINITIONS registry, extended MetricCollector with typed factory methods and 14 convenience methods, MetricEntry auto-resolves metric_type - **Infrastructure layer**: MetricsEmitter for structured log emission, metrics_log_processor for structlog integration - **Configuration**: metrics_enabled and metrics_export_prometheus settings, DI container registration - **Instrumentation**: Best-effort metric emission in PlanExecutor for plan_duration and plan_decision_count - **Testing**: 34 Behave BDD scenarios, 8 Robot Framework integration tests, ASV benchmark suite ## Validation - All 9762 unit test scenarios pass (0 failures) - All 8 new Robot integration tests pass - pyright strict mode: 0 errors - ruff lint: 0 errors - Coverage: 99% - vulture dead code: clean Closes #579
freemo added this to the v3.5.0 milestone 2026-03-10 08:19:09 +00:00
freemo force-pushed feature/m6-metrics-collection-framework from 3ebc613fd1 to 958eb0c060 2026-03-10 17:39:55 +00:00 Compare
freemo merged commit 958eb0c060 into master 2026-03-10 18:16:29 +00:00
freemo deleted branch feature/m6-metrics-collection-framework 2026-03-10 18:16:29 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#672