Skip to content

Key request telemetry by route path, not just method#20

Merged
edgrosvenor merged 1 commit into
mainfrom
fix-request-normalized-key
Jun 16, 2026
Merged

Key request telemetry by route path, not just method#20
edgrosvenor merged 1 commit into
mainfrom
fix-request-normalized-key

Conversation

@edgrosvenor

Copy link
Copy Markdown
Contributor

Problem

The slow-requests MCP tool could only report the slowest verb ("GET", p95 480 ms) with no path. Cause: Normalizer keyed request records on method + (route ?? uri), but real Nightwatch request payloads have neither field — they carry route_path (the bounded route pattern). So every request collapsed to its method.

Confirmed live: request payloads have route_path values like /posts/{post}, /built-for-cloud/{package}, /admin/posts/{record}/edit — route patterns (bounded cardinality), ideal for aggregation. Every other record type already keys correctly (query→sql, outgoing-request→method+host, command→name, etc.); request was the only broken one.

Fix

Add route_path to the request key resolution (route ?? route_path ?? uri), so requests group as GET /posts/{post}. Unmatched routes (empty route_path) still fall back to the bare method. Adds normalization test cases.

Follow-up (operational)

normalized_key is computed at ingest, so existing request raw_events are backfilled from payload->route_path and the aggregates re-rolled-up after deploy.

Verification

hone-server suite: 77 passed. PHPStan: 0 errors. Pint: clean.

🤖 Generated with Claude Code

The Normalizer keyed `request` records on method + (route ?? uri), but real
Nightwatch request payloads carry neither — they have `route_path` (the
bounded route pattern, e.g. /posts/{post}). So every request collapsed to
just its verb ("GET", "POST"), and the slow-requests MCP tool could only
report "the slowest GET" with no path.

Add `route_path` to the request key resolution (after route, before uri), so
requests group as "GET /posts/{post}". Unmatched routes (empty route_path)
still fall back to the bare method. Adds normalization test cases.

Note: normalized_key is computed at ingest, so existing raw_events are
backfilled from payload->route_path and re-rolled-up after deploy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@edgrosvenor edgrosvenor merged commit ea60f12 into main Jun 16, 2026
3 checks passed
@edgrosvenor edgrosvenor deleted the fix-request-normalized-key branch June 16, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant