Skip to content

feat(server-utils): Emit low-cardinality gen_ai agent span names when streaming - #23582

Draft
RulaKhaled wants to merge 4 commits into
developfrom
rolaabuhasna/js-3409-emit-low-cardinality-gen_ai-agent-span-names
Draft

feat(server-utils): Emit low-cardinality gen_ai agent span names when streaming#23582
RulaKhaled wants to merge 4 commits into
developfrom
rolaabuhasna/js-3409-emit-low-cardinality-gen_ai-agent-span-names

Conversation

@RulaKhaled

Copy link
Copy Markdown
Collaborator

With span streaming enabled (the default), gen_ai.invoke_agent names follow the agent span name conventions: {operation} {agent} when an agent name is known, otherwise {operation}.

LangChain chain names (chain format_prompt) and Vercel AI functionId suffixes are high-cardinality identifiers, so they are omitted from streamed names and remain on langchain.chain.name and gen_ai.function.id. LangGraph already emitted {operation} {agent} and is unchanged. Static traceLifecycle keeps the previous names.

Fixes #23524

… streaming

Fixes #23524

Co-Authored-By: Cursor <cursoragent@cursor.com>
@linear-code

linear-code Bot commented Aug 25, 2026

Copy link
Copy Markdown

JS-3409

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.59 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.6 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.51 kB - -
@sentry/browser (incl. Tracing, Replay) 88.04 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.75 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.45 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.31 kB - -
@sentry/react (incl. Tracing) 50.8 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.82 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.06 kB - -
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.94 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.98 kB - -
CDN Bundle (incl. Tracing, Replay) 86.56 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.34 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.27 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.74 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.43 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.36 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.17 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.87 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.53 kB - -
@sentry/nextjs (client) 53.34 kB - -
@sentry/sveltekit (client) 49.02 kB - -
@sentry/core/server 65.21 kB - -
@sentry/core/browser 52.34 kB - -
@sentry/node 121.75 kB +0.05% +55 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 87.55 kB +0.03% +22 B 🔺
@sentry/aws-serverless 95.97 kB +0.03% +23 B 🔺
@sentry/cloudflare (withSentry) - minified 199.48 kB - -
@sentry/cloudflare (withSentry) 495.44 kB - -

View base workflow run

RulaKhaled and others added 3 commits August 25, 2026 16:03
Streamed invoke_agent names should be derivable from attributes, not only from the span name.

Co-Authored-By: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit low cardinality gen_ai agent span names

1 participant