-
Notifications
You must be signed in to change notification settings - Fork 0
Exported Metrics
labels: router, method, path, status
The first thing anyone looks at: request rate, error rate, and the split by endpoint.
sum(rate(http_requests_total{status=~"5.."}[5m])) by (path)
This metric could not exist before the framework's handled event carried the response status. The information existed; nothing carried it.
labels: router, method, path
Latency distribution per route pattern. A series is pre-created when a route is registered, so an endpoint with no traffic yet still appears in the exposition rather than being absent until its first request.
histogram_quantile(0.95,
sum(rate(http_request_duration_seconds_bucket[5m])) by (le, path))
labels: router
Concurrent requests, maintained by middleware — incremented on entry,
decremented in a defer, so the pairing holds even if the handler panics.
labels: router, method
Requests that matched no route: 404s and 405s. A rising rate on a method that should not be used is a good early signal of a probe or a client that has drifted.
Sampled every CollectionInterval (5s by default; 0 disables the collector).
rex_uptime_seconds |
seconds since start |
rex_memory_bytes |
allocated heap |
rex_goroutines |
live goroutines |
These exist because the two mechanisms this extension depends on are lossy by design, and "the numbers are quietly wrong" is the worst failure a metrics system can have.
labels: vector
Time series folded into the overflow series because a vector hit its cardinality cap. Non-zero means a label is unbounded — alert on it.
rex_metric_series_dropped_total > 0
Events discarded by the event bus because its queue was full. Non-zero means a subscriber is too slow, or the queue is too small for the traffic, and that anything derived from events is now incomplete.
labels: router
Registered routes per router. Useful as a deployment sanity check: a drop after a release means routes stopped being registered.
OpenMetrics text, served at /metrics. Label values are escaped per the
specification, so a label containing a quote, a backslash or a newline does not
corrupt the document.
Registry.WriteOpenMetrics(w) streams; ToOpenMetrics() builds the whole
payload in memory first. The endpoint uses the streaming form.
scrape_configs:
- job_name: myapp
static_configs:
- targets: ['myapp:9090']Set the scrape interval above CollectionInterval, or process metrics are
scraped more often than they are sampled and you see stair-steps.
rextension-metric — Prometheus / OpenMetrics instrumentation for Rex · MIT · © 2026 Kryovyx
Ecosystem