Skip to content

Expose API request duration per route, and add a local API benchmark - #337

Merged
Shine-neko merged 2 commits into
mainfrom
feat/http-request-duration-metric
Nov 28, 2026
Merged

Shine-neko merged 2 commits into
mainfrom
feat/http-request-duration-metric

Conversation

@Shine-neko

Copy link
Copy Markdown
Contributor

Adds ring_http_server_request_duration_seconds to /metrics: a histogram per method, route template and status code, so p50/p95/p99 per route can be graphed and alerted on in Prometheus. With [server.telemetry.metrics] enabled it is also pushed over OTLP as http.server.request.duration, with the OpenTelemetry HTTP attribute names. The route label is the matched template (/deployments/{id}), never the raw path, and non-standard methods are recorded as _OTHER, so clients cannot inflate the series count.

Also adds bench/run.sh: it starts a throwaway server, load-tests a few routes with oha, prints req/s and p50/p99, compares with an earlier run (COMPARE=), and can profile one scenario with perf and pima (PROFILE=). It is meant for comparing a change against main locally, not for CI, where latency numbers are too noisy.

@Shine-neko
Shine-neko merged commit 8b13e25 into main Nov 28, 2026
6 checks passed
@Shine-neko
Shine-neko deleted the feat/http-request-duration-metric branch November 28, 2026 20:06
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