-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
Extend the existing MetricsRegistry with histogram and gauge metrics to provide richer observability over the service's performance and state.
Requirements:
- Add the following metrics to
MetricsRegistry:request_duration_seconds(Histogram with buckets: 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5) — HTTP request latencystellar_query_duration_seconds(Histogram) — Stellar Horizon query latencycache_size_entries(Gauge) — approximate number of entries in Redis cacheactive_connections(Gauge) — number of active HTTP connectionscircuit_breaker_state(Gauge with labelstate) — 0=closed, 1=half-open, 2=open
- Implement
MetricsRegistry::observe_request_duration(duration: f64)andobserve_stellar_duration(duration: f64) - Add Axum middleware that measures request duration and calls
observe_request_durationafter the response is sent - All metrics must have descriptive
helpstrings
Acceptance Criteria:
GET /metricsreturns valid Prometheus text format including the new histograms and gauges- Histogram buckets are correctly configured
- Middleware correctly measures end-to-end request time
- Unit tests verify metrics are incremented/observed correctly
Reactions are currently unavailable