Skip to content

Add Prometheus metrics for HTTP, votes, cache, and WebSocket#6

Merged
pscheid92 merged 1 commit intomainfrom
add-prometheus-metrics
Feb 22, 2026
Merged

Add Prometheus metrics for HTTP, votes, cache, and WebSocket#6
pscheid92 merged 1 commit intomainfrom
add-prometheus-metrics

Conversation

@pscheid92
Copy link
Owner

@pscheid92 pscheid92 commented Feb 22, 2026

Summary

  • Add internal/adapter/metrics/ package with Prometheus metrics for HTTP requests, vote pipeline, config cache, and WebSocket connections
  • Expose /metrics endpoint with chatpulse_*, go_*, and process_* collectors
  • Expand ProcessMessage return signature to include VoteTarget for per-direction vote counting
  • Promote prometheus/client_golang from indirect to direct dependency

Metrics

Metric Type Labels
chatpulse_http_request_duration_seconds Histogram method, route, status_code
chatpulse_http_requests_total Counter method, route, status_code
chatpulse_http_in_flight_requests Gauge
chatpulse_votes_processed_total Counter result
chatpulse_votes_processing_duration_seconds Histogram
chatpulse_votes_by_target_total Counter target
chatpulse_config_cache_hits_total Counter layer
chatpulse_config_cache_misses_total Counter layer
chatpulse_config_cache_invalidations_total Counter
chatpulse_websocket_active_connections Gauge
chatpulse_websocket_messages_published_total Counter

Test plan

  • make build compiles cleanly
  • make test-short — all unit tests pass (nil metrics in existing tests)
  • make lint — no violations
  • make run + curl localhost:8080/metrics returns Prometheus text format
  • make test — full integration tests pass

🤖 Generated with Claude Code

Instrument the application with Prometheus metrics covering HTTP request
duration/count, vote pipeline throughput and latency, config cache hit
rates, and WebSocket connection tracking. Exposes a /metrics endpoint
with standard go_* and process_* collectors alongside chatpulse_*
metrics. Expands ProcessMessage to return VoteTarget for per-direction
vote counting.
@pscheid92 pscheid92 merged commit 97f2def into main Feb 22, 2026
1 check passed
@pscheid92 pscheid92 deleted the add-prometheus-metrics branch February 22, 2026 22:10
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