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
{{ message }}
Repository navigation
Commit 41dfc75
Browse filesBrowse the repository at this point in the historyBrowse files
committed
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}` when the model is missing or empty. `gen_ai.execute_tool`
drops the tool name from the span name, which stays on `gen_ai.tool.name`.
Static lifecycle names are unchanged.
Every instrumented method supplies an operation, so the convention
fallback `Generative AI model operation` is unreachable and is not wired
up at any site.
Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: MIGRATION.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -778,7 +778,7 @@ The LangGraph instrumentation no longer emits `gen_ai.create_agent` spans when a
778
778
779
779
Affected SDKs: All SDKs.
780
780
781
-
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/).
781
+
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/).
782
782
783
783
If you [opt out of span streaming](#opting-out-of-span-streaming), span names remain unchanged.
784
784
@@ -789,9 +789,13 @@ The following span names were adjusted:
789
789
|`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 |
790
790
|`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 |
791
791
|`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`) |
792
+
|`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`) |
793
+
|`gen_ai.execute_tool`|`execute_tool {tool name}` (`execute_tool getWeather`) |`execute_tool`; the tool name stays on `gen_ai.tool.name`|
792
794
|`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 |
793
795
|`mcp.notification.client_to_server`, `mcp.notification.server_to_client`| The notification method name (`notifications/tools/list_changed`) | The notification method name, or `MCP notification` if the message carries none |
794
796
797
+
Resolved low-cardinality values are kept in both lifecycles: a known model stays in the name (`chat gpt-4`).
798
+
795
799
Resource spans now also carry a `url.domain` attribute holding that domain. The full URL remains available on `url.full`.
796
800
797
801
Some consequences to be aware of:
@@ -809,6 +813,7 @@ Child spans of a service or root span carry its name in their `sentry.segment.na
809
813
`ignoreSpans` is evaluated when a span **starts**, at which point a span might not yet have its final name. For example, an unresolved pageload span name is named `'Pageload'` and might receive its final, resolved route name later.
810
814
`ignoreSpans` filters matching a URL path no longer apply to them.
811
815
Another example where filters might need adjustments are `resource.*` spans where their name now only includes the domain the resource was taken from.
816
+
Likewise, 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'`).
0 commit comments