| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
size-limit report 📦
|
Sorry, something went wrong.
There was a problem hiding this comment.
There are some opportunities for a bit of factoring to reduce the overhead here and prune some dead fallback branches, but that can also be done in a subsequent followup.
Sorry, something went wrong.
There was a problem hiding this comment.
Isaac already brought up great points. Other then his points - LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 16742a1. Configure here.
Sorry, something went wrong.
…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.
… streaming (#23582) With span streaming enabled (the default), `gen_ai.invoke_agent` names follow the [agent span name conventions](https://getsentry.github.io/sentry-conventions/names/#gen_ai-agent): `{operation} {name}` from `gen_ai.agent.name`, `gen_ai.pipeline.name` or `gen_ai.function_id`, otherwise `{operation}`. In practice this only changes LangChain chain spans, and only their prefix. They were named `chain format_prompt`, which does not lead with the operation like every other agent span; they are now `invoke_agent format_prompt`. The chain name itself is bounded, so it stays in the name. A chain the SDK cannot name falls back to `invoke_agent` rather than carrying the `unknown_chain` sentinel, the same way a missing model is dropped in #23573. LangGraph agent names and Vercel AI `functionId`s are unchanged in both lifecycles — both are bounded, low-cardinality values. The `pipeline.name` and `function_id` templates are added in getsentry/sentry-conventions#593. LangChain still emits its chain name on `langchain.chain.name`; moving it to `gen_ai.pipeline.name` is tracked in [JS-3452](https://linear.app/getsentry/issue/JS-3452/move-langchainchainname-to-gen-aipipelinename) and should land before v11 ships, so the emitted name matches a published template. Span names are unaffected by that move — they are built from the local chain name, not read back off the attribute. The other two ops in the agent rule need nothing: the SDK emits no `gen_ai.handoff` spans, and `gen_ai.create_agent` was dropped in v11. Neither is listed in the migration table. The migration entry lives in `MIGRATION.md` rather than `docs/migration/v11-end-state.md`, which was removed by #23623. Fixes #23524 --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Two conflicts, both in the google-genai instrumentation that develop moved under us. packages/server-utils/src/ai/google-genai/index.ts: develop added low-cardinality span names when span streaming is on (getsentry#23573) and dropped the captureException calls from the instrumentation (getsentry#23024), touching the same lines where this branch threads the chat create-time params through. Kept both: the merged apply() computes attributeParams via mergeChatCreateParams, feeds those to extractRequestAttributes plus addPrivateRequestAttributes, then derives model with develop's || 'unknown' and its spanName sentinel logic. packages/server-utils/test/ai/lib/tracing/google-genai.test.ts: add/add, develop landed a span-names suite at the same path this branch used for the config suite. Took develop's file whole and re-added the config suite beside it, hoisting the shared setupClient to module scope and switching the config assertions from spanToJSON to spanToStaticSpanJSON, since spanToJSON now returns the streamed shape (attributes, no data). Also updated the Cloudflare integration test. Its chat span assertion matches attributes exhaustively with toEqual, while that scenario passes a config to chats.create, so propagating it adds temperature, top_p and max_tokens to the chat span. Verified the assertion fails without those three keys and passes with them. The node suites assert per key, so they were unaffected. Verified: @sentry/server-utils 432 tests passing (44 files), node google-genai and google-genai-v2 integration 24 passing, cloudflare google-genai integration 1 passing, oxfmt --check, oxlint --type-aware, oxlint src --type-aware --type-check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
When span streaming is enabled, gen_ai inference span names follow the inference templates: {operation} {model} when a model is known, {operation} when it is not. Instrumented methods always have an operation, so the convention fallback Generative AI model operation is not emitted today.
traceLifecycle: 'static' keeps the previous names (chat unknown). Known models stay in the name in both lifecycles (chat gpt-4).
The inference ops the SDK emits are gen_ai.chat, gen_ai.embeddings, gen_ai.generate_content and gen_ai.rerank — the last three were only added to the conventions' inference rule in sentry-conventions#579, but the naming here is derived from the operation rather than hardcoded per op, so they were already covered. The Vercel AI channel path never emitted an unknown model sentinel, so its names were already conformant; a test now locks that in. The SDK emits no gen_ai.responses or gen_ai.text_completion spans.
gen_ai.execute_tool spans keep the tool name in their name (execute_tool getWeather) — the tool name is a bounded, resolved value, so it behaves like a known model rather than a high-cardinality identifier. Agent ops (gen_ai.invoke_agent, gen_ai.create_agent, gen_ai.handoff) are out of scope here and handled in #23582 (JS-3409).
Fixes #23525