Skip to content

Commit 2edc029

Browse files
chargomeclaude
andauthored
docs(migration): Document low-cardinality http.server span names (#23598)
Adds the `http.server` row to the v11 span name section and calls out that `tracesSampler` and `ignoreSpans` can no longer match on span name — they run at span start, before a route exists, so name-based rules stop matching silently. Stacked on #23597. Fixes #23527 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent ec24672 commit 2edc029

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

MIGRATION.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ The following span names were adjusted:
793793
| Span op | Before | After |
794794
| ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
795795
| `pageload` | The parameterized route, or the raw URL path if the SDK couldn't resolve one (`/users/123`) | The parameterized route, or `Pageload` if the SDK has none |
796+
| `http.server` | The request method and route, or the raw URL path if the SDK couldn't resolve one (`GET /users/123`) | `GET /users/:id` when a route is known, otherwise just the request method (`GET`) |
796797
| `router` | Framework-specific, sometimes containing the raw URL (`/users/123`, `SvelteKit Route Change`) | The span's `http.route`, or `Router` if the SDK has none |
797798
| `graphql` | The graphql phase and, for operations, the operation name (`query GetUser`, `graphql.parse`, `graphql.resolve user.0.name`) | The operation type, or the processing type where there is none (`GraphQL query`, `GraphQL parse`, `GraphQL resolve`) |
798799
| `resource.*` | The resource URL, relative to the page origin for same-origin resources (`/assets/app.js`) | The resource domain (`cdn.example.com`), or `Resource` if the SDK has none |
@@ -801,6 +802,8 @@ The following span names were adjusted:
801802

802803
Resource spans now also carry a `url.domain` attribute holding that domain. The full URL remains available on `url.full`.
803804

805+
`http.server` requests that resolve to a route are **unchanged** — those names were already low cardinality. Only requests the SDK cannot parameterize are affected.
806+
804807
Some consequences to be aware of:
805808

806809
The graphql operation name and the resolver field path are supplied by the client, so they are no longer part of a span name. They remain available on the `graphql.operation.name` and `graphql.field.path` attributes.
@@ -831,6 +834,29 @@ Sentry.init({
831834
});
832835
```
833836

837+
The same applies to `tracesSampler`, which also runs at span start. A web framework matches the route
838+
_after_ that point, so an `http.server` span is named `GET` when your rule is evaluated — never
839+
`GET /health`. Name-based rules stop matching **silently**: no error, no warning, just unexpected quota
840+
usage. No route attribute is set at that point either, so match on `url.path`:
841+
842+
```js
843+
Sentry.init({
844+
// Before
845+
tracesSampler: ({ name, inheritOrSampleWith }) => inheritOrSampleWith(name === 'GET /health' ? 0 : 1),
846+
847+
// After
848+
tracesSampler: ({ attributes, inheritOrSampleWith }) =>
849+
inheritOrSampleWith(attributes?.['url.path'] === '/health' ? 0 : 1),
850+
});
851+
```
852+
853+
On `@sentry/nextjs` the incoming-request span comes from Next.js' own OpenTelemetry instrumentation, so
854+
match on `url.full` or `http.target` if `url.path` is absent. `normalizedRequest.url` is also available on
855+
the sampling context.
856+
857+
Error grouping is **not** affected by the `http.server` change: the scope's transaction name still holds
858+
the full `${method} ${path}`.
859+
834860
### AI integrations no longer trace non-inference operations
835861
836862
Affected SDKs: All server-side SDKs.

0 commit comments

Comments
 (0)