Expand description
PR-94: Prometheus /metrics endpoint + HTTP metrics middleware.
This module is a thin wrapper around ff_observability::Metrics.
It compiles in both feature configurations:
observabilityoff —Metricsre-exports the no-op shim so call sites inapi::routeruse an identical signature. The/metricsroute is not mounted (seeapi::router) so serve is 404; the HTTP middleware is not installed.observabilityon — real OTEL-backed registry,/metricsmounted, HTTP middleware installed that recordsff_http_requests_total+ff_http_request_duration_secondslabelled bymethod+path(MatchedPath, so parameterized paths like/v1/executions/{id}collapse to one series) +status.
Structs§
- Metrics
- Zero-sized no-op registry. Identical public shape to the real
implementation (see
real.rs) so call sites don’t know which backend they’re hitting.
Functions§
- http_
middleware - Axum middleware: record HTTP method +
MatchedPath+ status + duration. - metrics_
handler - GET /metrics — Prometheus text exposition (
text/plain; version=0.0.4).