Repository navigation
Open
Description
Description
Expose request-count, latency and error observations so applications can track volume, latency percentiles and error rate.
Current middleware records formatted request logs; no public metrics hook/observer abstraction is exported. KV timing logs measure store operations, not request metric aggregation.
Steps to reproduce
- Inspect core middleware and module exports for a metrics observer.
- Compare request log output with count, duration-distribution and error observations needed by a metrics backend.
Expected behavior
Applications can attach a metrics backend to reusable request observations without replacing request handling.
Impact
Applications must implement timing/count/error hooks independently before exporting request metrics.
Proposed fix
Define a portable request-observation hook with bounded labels and explicit completion/error boundaries; leave backend aggregation/export and percentiles to the selected metrics integration.
Done when
- Hooks expose request count, duration and outcome/error facts.
- Route/method/status labels and unmatched/error behavior are defined.
- A backend example derives request rate, error rate and latency percentiles.
- Hooks respect the portable runtime boundary and avoid unbounded per-request label state.
Related
- Parent: Complete portable request observability #118.
- Timing collection: Expose request latency automatically #120 and Add a shared request-timing collector and opt-in attachment middleware #446.
- Native diagnostics: Axum: add safe production diagnostics and trusted-proxy handling #397.
- Built-in request logger
- Core public module surface
- Related PR feat(core): add shared request timing collector and middleware #389; this PR alone does not establish completion of this issue.
- Related PR feat(axum): add safe diagnostics and trusted proxy metadata #409; this PR alone does not establish completion of this issue.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Metrics hooks[/-][+]Add request metrics hooks[/+]