Skip to content

feat(sponsor-panel): add Prometheus metrics for SRE observability#1184

Open
Xe wants to merge 1 commit intomainfrom
Xe/sponsor-panel-more-metrics
Open

feat(sponsor-panel): add Prometheus metrics for SRE observability#1184
Xe wants to merge 1 commit intomainfrom
Xe/sponsor-panel-more-metrics

Conversation

@Xe
Copy link
Owner

@Xe Xe commented Mar 26, 2026

Summary

  • Add per-handler HTTP request duration histograms (sponsor_panel_http_request_duration_seconds) with handler, method, and status code labels
  • Add per-handler failure/success counters (sponsor_panel_http_requests_total) and in-flight gauges (sponsor_panel_http_requests_in_flight)
  • Add response size histograms (sponsor_panel_http_response_size_bytes)
  • Add sponsor sync metrics: duration histogram, success/error counter, active sponsors gauge
  • Add OAuth login counters by provider and result (success, state mismatch, token exchange error, upsert error)
  • Add session decode error counter

Metrics exposed

Metric Type Labels
sponsor_panel_http_request_duration_seconds Histogram handler, method, code
sponsor_panel_http_requests_total Counter handler, method, code
sponsor_panel_http_requests_in_flight Gauge handler
sponsor_panel_http_response_size_bytes Histogram handler
sponsor_panel_sync_duration_seconds Histogram
sponsor_panel_sync_total Counter result
sponsor_panel_active_sponsors Gauge
sponsor_panel_oauth_total Counter provider, result
sponsor_panel_session_errors_total Counter

Test plan

  • go build ./cmd/sponsor-panel/ passes
  • Verify /metrics endpoint exposes new metrics after deploying
  • Confirm handler labels match expected route names in Prometheus/Grafana

Add per-handler HTTP request histograms, failure counters, in-flight
gauges, response size histograms, sponsor sync metrics, OAuth login
counters, and session error tracking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant