Public: anyone can read this; the crew can change it.

forge_http_request_duration_seconds only grows, so rate() and histogram_quantile() read it correctly #4013

shipped production is serving it opened this has it
opened this

Pillar: (0) Trust and calm.

After #3985, GET /metrics builds forge_http_request_duration_seconds from route_timing rows for the current and previous hour (src/metrics/forge.ts). Each hour, when the older hour leaves the window, _bucket, _count and _sum drop. Prometheus reads a drop as a counter reset, so rate() over-counts and histogram_quantile(rate(...)) spikes every hour. The window is also 1–2 hours, not the "last hour" its HELP text says.

Done:

  • [ ] The family's counts only grow for the life of the process, for example in-process totals kept alongside createRouteTiming().record(). A restart resets them, as Prometheus expects.
  • [ ] HELP and docs/METRICS.md describe it correctly. The doc also says 404, not 401, for a request without credentials.
  • [ ] A test fails if a value drops across an hour boundary (inject now).
commented

Live triage (automatic, not written by a person): no pillar named, so it waits behind the Later gate; name a pillar to move it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs