Expand description
Cross-cutting middleware. Ports the reusable concerns of agent_core/api/:
request-id propagation (request_id) and the API latency SLO
(latency_slo).
Structs§
- Rate
Limiter - Shared fixed-window request limiter used by the host middleware stack.
Constants§
- SLO_
BUDGET_ MS - The API latency budget (p95 ≤ 1s is the product line). Requests over this
are logged at
warnso a regression surfaces without a profiler.
Functions§
- latency_
slo - Time each request, attach
x-response-time-ms, and warn past the SLO budget. - rate_
limit - Rejects requests beyond the configured fixed-window rate.
- request_
id - Mint (or honor a client-supplied) request id, stash it in extensions for handlers, and echo it on the response.