corvix.observability.middleware¶
ASGI middleware recording per-request metrics, request IDs, and trace spans.
Sits outermost in the middleware stack so it observes every request (including
auth failures), tags each one with a request_id bound into the logging
context and echoed back in the X-Request-ID response header, and records
request counts and latency by method, endpoint, and status.
Attributes¶
Classes¶
Record request metrics, bind a request ID, and open a trace span. |
Functions¶
|
Return a low-cardinality endpoint label from the matched route. |
|
Module Contents¶
- corvix.observability.middleware._endpoint_label(scope: litestar.types.asgi_types.Scope) str[source][source]¶
Return a low-cardinality endpoint label from the matched route.
Uses the registered path template (e.g.
/api/v1/notifications/{account_id}/...) rather than the concrete path so per-ID paths do not explode label cardinality.
- corvix.observability.middleware._request_id(scope: litestar.types.asgi_types.Scope) str[source][source]¶