You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(server-utils): Emit low-cardinality gen_ai inference span names when streaming
When span streaming is on, inference spans use `{operation} {model}` or
`{operation}` if the model is missing, and execute_tool drops the tool
name from the span name. Static lifecycle names are unchanged.
Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: MIGRATION.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -617,17 +617,21 @@ These changes are not caught by TypeScript. If you filter, group, or alert on sp
617
617
618
618
Affected SDKs: All SDKs.
619
619
620
-
With [span streaming](#span-streaming-is-now-the-default) enabled(the default), span names are now **low cardinality**, following the [Sentry span name conventions](https://getsentry.github.io/sentry-conventions/names/).
620
+
With [span streaming](#span-streaming-is-now-the-default) enabled(the default), span names are now **low cardinality**, following the [Sentry span name conventions](https://getsentry.github.io/sentry-conventions/names/).
621
621
622
-
In v11, this affects `pageload`and `graphql` spans. Further ops will follow in future releases.
622
+
In v11, this affects `pageload`, `graphql`, and `gen_ai` spans. Further ops will follow in future releases.
623
623
If you [opt out of span streaming](#opting-out-of-span-streaming), span names remain unchanged.
|`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 |
630
-
|`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`) |
|`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 |
630
+
|`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`) |
631
+
|`gen_ai.chat`, `gen_ai.embeddings`, `gen_ai.generate_content`, … |`{operation} {model}`, or `{operation} unknown` if the model is missing (`chat unknown`) |`{operation} {model}`, or `{operation}` if the model is missing (`chat`). Instrumented methods always have an operation, so the convention fallback `Generative AI model operation` is unused today. |
632
+
|`gen_ai.execute_tool`|`execute_tool {tool name}` (`execute_tool getWeather`) |`execute_tool`; the tool name stays on `gen_ai.tool.name`|
633
+
634
+
Resolved low-cardinality values are kept in both lifecycles: a known model stays in the name (`chat gpt-4`).
631
635
632
636
Some consequences to be aware of:
633
637
@@ -639,7 +643,7 @@ For the same reason, `useOperationNameForRootSpan` no longer renames the enclosi
639
643
640
644
Child spans of a pageload span carry its name in their `sentry.segment.name` attribute, so that changes with it. If you group or filter spans by segment name in dashboards or alerts, update those references.
641
645
642
-
`ignoreSpans` is evaluated when a span **starts**, at which point a pageload span without a resolved route is already named `'Pageload'`, so filters matching a URL path no longer apply to it. Match on attributes instead:
646
+
`ignoreSpans` is evaluated when a span **starts**. Filters matching a raw URL path no longer apply to an unresolved pageload (`'Pageload'`), filters matching `chat unknown` no longer apply to a streamed chat span (`'chat'`), and filters matching `execute_tool getWeather`no longer apply to a streamed tool span (`'execute_tool'`). Match on attributes instead:
Copy file name to clipboardExpand all lines: docs/migration/v11-end-state.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -475,6 +475,23 @@ Sentry.init({
475
475
476
476
In Node, Bun, Vercel Edge and Cloudflare you can also set the `SENTRY_TRACE_LIFECYCLE=static` environment variable instead. The static lifecycle only exists for backwards compatibility and is planned for removal in a future major version, so treat this as a temporary measure.
477
477
478
+
### Span name changes
479
+
480
+
Affected SDKs: All SDKs.
481
+
482
+
With [span streaming](#span-streaming-is-now-the-default) enabled (the default), span names are now **low cardinality**, following the [Sentry span name conventions](https://getsentry.github.io/sentry-conventions/names/). If you [opt out of span streaming](#opting-out-of-span-streaming), span names remain unchanged.
| `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 |
487
+
| `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`) |
488
+
| `gen_ai.chat`, `gen_ai.embeddings`, `gen_ai.generate_content`, … | `{operation} {model}`, or `{operation} unknown` if the model is missing (`chat unknown`) | `{operation} {model}`, or `{operation}` if the model is missing (`chat`). Instrumented methods always have an operation, so the convention fallback `Generative AI model operation` is unused today. |
489
+
| `gen_ai.execute_tool` | `execute_tool {tool name}` (`execute_tool getWeather`) | `execute_tool`; the tool name stays on `gen_ai.tool.name` |
490
+
491
+
Resolved low-cardinality values are kept in both lifecycles: a known model stays in the name (`chat gpt-4`).
492
+
493
+
`ignoreSpans` is evaluated at span start. Filters matching `chat unknown` no longer apply to a streamed chat span named `'chat'`; match on `gen_ai.request.model` instead. Filters matching `execute_tool getWeather` no longer apply to a streamed tool span named `'execute_tool'`; match on `gen_ai.tool.name` instead.
0 commit comments