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

Merged
freemo merged 1 commit 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
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 20s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 39s
CI / unit_tests (pull_request) Failing after 2m50s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 3m10s
CI / coverage (pull_request) Successful in 4m54s
CI / benchmark-regression (pull_request) Successful in 31m39s
to 958eb0c060
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 19s
CI / typecheck (pull_request) Successful in 37s
CI / security (pull_request) Successful in 51s
CI / unit_tests (pull_request) Successful in 2m41s
CI / integration_tests (pull_request) Successful in 3m19s
CI / docker (pull_request) Successful in 51s
CI / coverage (pull_request) Successful in 5m7s
CI / benchmark-regression (pull_request) Successful in 33m26s
CI / lint (push) Successful in 13s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 33s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m2s
CI / integration_tests (push) Successful in 3m12s
CI / docker (push) Successful in 49s
CI / coverage (push) Successful in 6m10s
CI / benchmark-publish (push) Has been cancelled
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 milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!672
No description provided.