feat: add OpenTelemetry metrics with Prometheus-compatible export#52
Merged
feat: add OpenTelemetry metrics with Prometheus-compatible export#52
Conversation
Implements observability instrumentation with metrics collection for HTTP requests and business operations. Metrics can be enabled/disabled via METRICS_ENABLED configuration and are exposed at GET /metrics endpoint in Prometheus exposition format for scraping and monitoring. Major additions: - internal/metrics package with Provider, HTTP middleware, and business operation decorators - Prometheus exporter with configurable namespace prefix (METRICS_NAMESPACE) - Four metric families: http_requests_total, http_request_duration_seconds, operations_total, operation_duration_seconds - UseCase decorators for auth, secrets, and transit domains tracking operation counts and latencies with domain, operation, and status labels - HTTP metrics middleware recording request counts and durations by method, path, and status_code - Runtime disable behavior: when METRICS_ENABLED=false, metrics middleware and /metrics route are not registered Documentation updates: - Added docs/operations/monitoring.md with quickstart, metrics contract, Prometheus/Grafana examples, and production hardening guidance - Added docs/releases/v0.3.0.md release notes - Updated environment variable defaults and CLI command examples across getting-started, configuration, and operations guides - Added metrics troubleshooting matrix and feature PR docs consistency checklist to contributing guide - Updated README with v0.3.0 highlights and monitoring links Breaking changes: None (additive feature) Compatibility: API v1 remains stable, metrics endpoint outside versioning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements observability instrumentation with metrics collection for HTTP requests and business operations. Metrics can be enabled/disabled via METRICS_ENABLED configuration and are exposed at GET /metrics endpoint in Prometheus exposition format for scraping and monitoring.
Major additions:
Documentation updates:
Breaking changes: None (additive feature)
Compatibility: API v1 remains stable, metrics endpoint outside versioning