-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
No Metrics/Observability
Priority: P1 - High
Estimate: 3 hours
Review Reference: REVIEW.md (P1-5)
Issue
No visibility into:
- Request rates and latency
- Error rates
- Resource utilization
- Pool/account counts
Impact: High - Cannot monitor production health
Solution
Add Prometheus metrics with /metrics endpoint.
Key Metrics:
cloudpam_http_requests_total- Counter with method, path, status labelscloudpam_http_duration_seconds- Histogram for latencycloudpam_pools_total- Gauge for pool countcloudpam_accounts_total- Gauge for account count
Implementation:
- Add
github.com/prometheus/client_golangdependency - Create
internal/http/metrics.go - Instrument key operations
- Add
/metricsendpoint in RegisterRoutes()
See REVIEW.md (P1-5) for complete code.
Acceptance Criteria
- Prometheus client_golang dependency added
- metrics.go created with key metrics
- HTTP requests instrumented with counters and histograms
- Pool/account counts exposed as gauges
- /metrics endpoint returns Prometheus format
- Tests verify metric collection
- CLAUDE.md updated with metrics documentation
Related
- Consider OpenTelemetry tracing (optional) #41 (OpenTelemetry) for distributed tracing
- Complements Rate limiting and structured request logs #17 (structured logging)