Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'develop' into nh/vercel-ops-registry
  • Loading branch information
nicohrubec committed Apr 15, 2026
commit fc90b276236af6658f177751700e3b37e8337ec8
10 changes: 7 additions & 3 deletions packages/core/src/tracing/vercel-ai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,13 @@ function processEndedVercelAiSpan(span: SpanJSON): void {
// Rename AI SDK attributes to standardized gen_ai attributes
// Map operation.name to OpenTelemetry semantic convention values
if (attributes[OPERATION_NAME_ATTRIBUTE]) {
const operationName =
SPAN_TO_OPERATION_NAME.get(attributes[OPERATION_NAME_ATTRIBUTE] as string) ??
(attributes[OPERATION_NAME_ATTRIBUTE] as string);
// V6+ sets ai.operationId to the bare operation (e.g. "ai.streamText") while
// operation.name appends functionId (e.g. "ai.streamText myAgent").
// When ai.operationId is present, use it for correct mapping.
const rawOperationName = attributes[AI_OPERATION_ID_ATTRIBUTE]
? (attributes[AI_OPERATION_ID_ATTRIBUTE] as string)
: (attributes[OPERATION_NAME_ATTRIBUTE] as string);
const operationName = SPAN_TO_OPERATION_NAME.get(rawOperationName) ?? rawOperationName;
attributes[GEN_AI_OPERATION_NAME_ATTRIBUTE] = operationName;
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete attributes[OPERATION_NAME_ATTRIBUTE];
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.