Repository navigation
Description
Description
Capture request duration and expose it through logs or headers without requiring application-written timing code.
The built-in RequestLogger records elapsed_ms on successful and failed request handling and emits tracing log events. Generated application manifests install this middleware, so callers can use the existing logging integration without writing timestamp calculations. The duration is the middleware/handler interval; this issue did not require full streamed-response completion timing.
Steps to reproduce
- Inspect
RequestLoggersuccess/error branches and theirelapsed_msevents. - Inspect the generated application manifest's built-in middleware registration.
- Use the application's configured tracing output to consume these existing events; this audit did not execute a runtime probe.
Expected behavior
Built-in request middleware captures duration and emits a log signal without custom timing calculations.
Impact
The original automatic request-latency capability is available. Consistent adapter logging sinks and richer phase/lifecycle timing remain separate work.
Proposed fix
Close as completed using RequestLogger. Keep cross-adapter logging integration in #119 and generic timing-collector work in #446 / #389.
Done when
- Built-in middleware captures request duration.
- Success and error events include
elapsed_msthrough the existing tracing facade. - Generated application configuration registers the built-in middleware without application-written timing code.
Related
- Parent: Complete portable request observability #118.
- Consistent structured logging: Provide consistent structured logs across adapters #119.
- Generic timing collector: Add a shared request-timing collector and opt-in attachment middleware #446.
- Related PR feat(core): add shared request timing collector and middleware #389 adds collection capabilities beyond this original scope; it is not required to close this issue.
- Built-in request timing/log events.
- Scaffold middleware registration.
The requested implementation is present on the audited main revision. This audit inspected source and existing coverage; it did not rerun the tests.
Activity
[-]As a developer I want to measure request latency automatically[/-][+]Expose request latency automatically[/+]