Diagnose: infinite transaction names from URL parameters
Shows how to fix diagnose: infinite transaction names from URL parameters. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Dashboards are useless, issue grouping fragments, and span quota burns on cardinality instead of signal.
Steps
- Thousands of distinct transaction names like
GET /accounts/48291,GET /accounts/77123, each with one event. Dashboards are useless, issue grouping fragments, and span quota burns on cardinality instead of signal. - The transaction name includes raw URL parameters. Framework integrations normally parameterize routes (
GET /accounts/[id]), but this breaks when: the route is not registered with the framework router (custom handlers, middleware), the integration does not recognize the framework, or you name transactions manually with the raw path. - Name transactions by route pattern, not by URL:
# instead of request.path
transaction_name = f"{request.method} {request.resolver_match.route}"Sentry.startSpan({ op: "http.server", name: "GET /accounts/[id]" }, () => { /* ... */ });- Put IDs and other high-cardinality values in attributes/tags instead, where they are searchable but do not create new groupings:
Sentry.setAttribute("user.id", userId); // searchable, not a new transaction name- In the transaction summary, sort by count of distinct names. A long tail of single-event names with the same shape is the fingerprint. After the fix, the tail collapses into a handful of route patterns.
When to use
You are seeing this: Thousands of distinct transaction names like GET /accounts/48291, GET /accounts/77123, each with one event. Use this skill when you run into "Diagnose: infinite transaction names from URL parameters".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The transaction name includes raw URL parameters.