Skip to content

feat: add Prometheus HTTP metrics middleware#17

Merged
ruoka merged 1 commit into
masterfrom
feat/prometheus-metrics-middleware
Jul 16, 2026
Merged

feat: add Prometheus HTTP metrics middleware#17
ruoka merged 1 commit into
masterfrom
feat/prometheus-metrics-middleware

Conversation

@ruoka

@ruoka ruoka commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add metrics_registry / metrics_middleware() for http_requests_total and http_request_duration_seconds (labels: method, status)
  • Short-circuit GET /metrics with Prometheus text exposition; scrapes are not counted
  • Add [net] BDD coverage for counters, error status, and scrape isolation

Test plan

  • ./tools/CB.sh debug test "metrics_middleware" (12/12)
  • Full suite previously green after integration

Made with Cursor

Record method/status counters and latency histograms, and serve GET /metrics
as Prometheus text exposition without counting scrapes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ruoka
ruoka merged commit 9ac5aa7 into master Jul 16, 2026
@ruoka
ruoka deleted the feat/prometheus-metrics-middleware branch July 16, 2026 12:27
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