Exclude routeless requests from slow endpoint ranking#21
Merged
Conversation
Unmatched requests (e.g. 404 scanner traffic) have an empty route_path, so the normalizer collapses them to a bare HTTP method key like "GET". On busy sites that single bucket aggregates large volumes of unrelated URLs, and its inflated p95 dominates the slow_requests ranking, so the slowest "endpoint" reads as just the verb with no route. Add an opt-in routeless filter to AggregateWindow::topOffenders that requires a space in the key (METHOD /path), drop the bare-method buckets, and have SlowRequestsTool enable it. Other slow tools (queries, jobs, outgoing) are unaffected. Routeless traffic remains stored for error telemetry; it just no longer masquerades as an endpoint. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the live demo, the slowest HTTP endpoint by p95 was answered as just GET with no route.
Root cause (confirmed against the live
aggregatestable): the 598fa56 normalizer fix is deployed and working — real routes key correctly (GET /posts/{post},POST /livewire/update). But requests that don't match a route have an emptyroute_path, so the normalizer collapses them to the bare methodGET. Onartisan.buildthat bucket is 100% HTTP 404s — bot/vuln scans (wp-admin/*,actuator/env,joomla.xml,sitemap.xml, …). ~172 of them today lump into oneGETbucket whose p95 (~2,896 ms) outranks every real route, so it surfaces as "the slowest endpoint."It was never stale data or the key fix failing — routeless 404 traffic was being ranked as an endpoint.
Fix
Query-layer change (no data migration needed — stale/ongoing
GETbuckets simply stop being ranked):AggregateWindow::topOffenders()— opt-in$excludeRoutelessthat filters to keys containing a space (METHOD /path), dropping bare-method buckets.HandlesSlowMetricTool— overridableexcludesRoutelessKeys()(defaultfalse, so slow queries/jobs/outgoing are unaffected).SlowRequestsTool— overrides it totrue.After deploy,
slow_requestsreturns the slowest real route. The 404 traffic stays stored for error telemetry; it just no longer masquerades as an endpoint.Tests
Added two tests (routeless excluded for requests; routeless still ranked for non-request metrics). Full
McpMetricToolsTestgreen (32 passed), Pint clean.🤖 Generated with Claude Code