diff --git a/MIGRATION.md b/MIGRATION.md index 438b2572f682..6de7ba165072 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -252,6 +252,7 @@ Affected SDKs: All SDKs. - `network.*` span attributes were aligned across SDKs. - Legacy messaging (`messaging.*`) and database (`db.statement`, …) span attributes on the AMQP and Redis instrumentations were replaced by their current semantic-convention equivalents. - The gen_ai cache token attributes `gen_ai.usage.cache_creation_input_tokens` and `gen_ai.usage.cache_read_input_tokens` were renamed to `gen_ai.usage.cache_creation.input_tokens` and `gen_ai.usage.cache_read.input_tokens`. +- The `gen_ai.system` span attribute was renamed to `gen_ai.provider.name` across all AI integrations. - Span attributes now use the shared `@sentry/conventions` package under the hood. If you reference these attributes in custom instrumentation, `beforeSendSpan`, dashboards, or alerts, update them to the new names. diff --git a/dev-packages/cloudflare-integration-tests/suites/tracing/anthropic-ai/test.ts b/dev-packages/cloudflare-integration-tests/suites/tracing/anthropic-ai/test.ts index 77e4269e40b6..a02dc42ebd06 100644 --- a/dev-packages/cloudflare-integration-tests/suites/tracing/anthropic-ai/test.ts +++ b/dev-packages/cloudflare-integration-tests/suites/tracing/anthropic-ai/test.ts @@ -2,13 +2,13 @@ import { expect, it } from 'vitest'; import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_RESPONSE_ID, GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_TEXT, - GEN_AI_SYSTEM, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, GEN_AI_USAGE_TOTAL_TOKENS, @@ -42,7 +42,7 @@ it('traces a basic message creation request with the anthropic SDK', async ({ si attributes: { 'sentry.origin': { value: 'auto.ai.anthropic', type: 'string' }, 'sentry.op': { value: 'gen_ai.chat', type: 'string' }, - [GEN_AI_SYSTEM]: { value: 'anthropic', type: 'string' }, + [GEN_AI_PROVIDER_NAME]: { value: 'anthropic', type: 'string' }, [GEN_AI_OPERATION_NAME]: { value: 'chat', type: 'string' }, [GEN_AI_REQUEST_MODEL]: { value: 'claude-3-haiku-20240307', type: 'string' }, [GEN_AI_REQUEST_TEMPERATURE]: { value: 0.7, type: 'double' }, diff --git a/dev-packages/cloudflare-integration-tests/suites/tracing/google-genai/test.ts b/dev-packages/cloudflare-integration-tests/suites/tracing/google-genai/test.ts index e98f0a68bf0a..879205bbe5f0 100644 --- a/dev-packages/cloudflare-integration-tests/suites/tracing/google-genai/test.ts +++ b/dev-packages/cloudflare-integration-tests/suites/tracing/google-genai/test.ts @@ -4,12 +4,12 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_REQUEST_TOP_P, GEN_AI_RESPONSE_TEXT, - GEN_AI_SYSTEM, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, GEN_AI_USAGE_TOTAL_TOKENS, @@ -46,7 +46,7 @@ it('traces Google GenAI chat, generateContent, and embedContent calls', async ({ attributes: { 'sentry.origin': { value: 'auto.ai.google_genai', type: 'string' }, 'sentry.op': { value: 'gen_ai.chat', type: 'string' }, - [GEN_AI_SYSTEM]: { value: 'google_genai', type: 'string' }, + [GEN_AI_PROVIDER_NAME]: { value: 'google_genai', type: 'string' }, [GEN_AI_OPERATION_NAME]: { value: 'chat', type: 'string' }, [GEN_AI_REQUEST_MODEL]: { value: 'gemini-1.5-pro', type: 'string' }, // collect LLM input and outputs (default true) @@ -70,7 +70,7 @@ it('traces Google GenAI chat, generateContent, and embedContent calls', async ({ attributes: { 'sentry.origin': { value: 'auto.ai.google_genai', type: 'string' }, 'sentry.op': { value: 'gen_ai.generate_content', type: 'string' }, - [GEN_AI_SYSTEM]: { value: 'google_genai', type: 'string' }, + [GEN_AI_PROVIDER_NAME]: { value: 'google_genai', type: 'string' }, [GEN_AI_OPERATION_NAME]: { value: 'generate_content', type: 'string' }, [GEN_AI_REQUEST_MODEL]: { value: 'gemini-1.5-flash', type: 'string' }, [GEN_AI_REQUEST_TEMPERATURE]: { value: 0.7, type: 'double' }, @@ -99,7 +99,7 @@ it('traces Google GenAI chat, generateContent, and embedContent calls', async ({ attributes: { 'sentry.origin': { value: 'auto.ai.google_genai', type: 'string' }, 'sentry.op': { value: 'gen_ai.embeddings', type: 'string' }, - [GEN_AI_SYSTEM]: { value: 'google_genai', type: 'string' }, + [GEN_AI_PROVIDER_NAME]: { value: 'google_genai', type: 'string' }, [GEN_AI_OPERATION_NAME]: { value: 'embeddings', type: 'string' }, [GEN_AI_REQUEST_MODEL]: { value: 'text-embedding-004', type: 'string' }, [GEN_AI_EMBEDDINGS_INPUT]: { value: 'Hello world', type: 'string' }, diff --git a/dev-packages/cloudflare-integration-tests/suites/tracing/langchain/test.ts b/dev-packages/cloudflare-integration-tests/suites/tracing/langchain/test.ts index 09fabdefb3d3..e70cb02fec9b 100644 --- a/dev-packages/cloudflare-integration-tests/suites/tracing/langchain/test.ts +++ b/dev-packages/cloudflare-integration-tests/suites/tracing/langchain/test.ts @@ -1,13 +1,13 @@ import { expect, it } from 'vitest'; import { GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_RESPONSE_FINISH_REASONS, GEN_AI_RESPONSE_ID, GEN_AI_RESPONSE_MODEL, - GEN_AI_SYSTEM, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, GEN_AI_USAGE_TOTAL_TOKENS, @@ -42,7 +42,7 @@ it('traces a LangChain chat model invocation', async ({ signal }) => { attributes: { 'sentry.origin': { value: 'auto.ai.langchain', type: 'string' }, 'sentry.op': { value: 'gen_ai.chat', type: 'string' }, - [GEN_AI_SYSTEM]: { value: 'openai', type: 'string' }, + [GEN_AI_PROVIDER_NAME]: { value: 'openai', type: 'string' }, [GEN_AI_OPERATION_NAME]: { value: 'chat', type: 'string' }, [GEN_AI_REQUEST_MODEL]: { value: 'gpt-3.5-turbo', type: 'string' }, [GEN_AI_REQUEST_TEMPERATURE]: { value: 0.7, type: 'double' }, diff --git a/dev-packages/cloudflare-integration-tests/suites/tracing/openai/test.ts b/dev-packages/cloudflare-integration-tests/suites/tracing/openai/test.ts index 5675bfa7a080..409941359399 100644 --- a/dev-packages/cloudflare-integration-tests/suites/tracing/openai/test.ts +++ b/dev-packages/cloudflare-integration-tests/suites/tracing/openai/test.ts @@ -2,12 +2,12 @@ import { expect, it } from 'vitest'; import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_RESPONSE_FINISH_REASONS, GEN_AI_RESPONSE_ID, GEN_AI_RESPONSE_MODEL, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -42,7 +42,7 @@ it('traces a basic chat completion request with the openai SDK', async ({ signal attributes: { 'sentry.origin': { value: 'auto.ai.openai', type: 'string' }, 'sentry.op': { value: 'gen_ai.chat', type: 'string' }, - [GEN_AI_SYSTEM]: { value: 'openai', type: 'string' }, + [GEN_AI_PROVIDER_NAME]: { value: 'openai', type: 'string' }, [GEN_AI_OPERATION_NAME]: { value: 'chat', type: 'string' }, [GEN_AI_REQUEST_MODEL]: { value: 'gpt-3.5-turbo', type: 'string' }, [GEN_AI_REQUEST_TEMPERATURE]: { value: 0.7, type: 'double' }, diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-anthropic/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-anthropic/test.ts index 0e92fdd1e6dc..900458bb9672 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-anthropic/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-anthropic/test.ts @@ -51,7 +51,7 @@ Deno.test('anthropic instrumentation: orchestrion @anthropic-ai/sdk:chat channel const aiSpan = parent.spans?.find(s => s.op === 'gen_ai.chat'); assertExists(aiSpan, `expected a gen_ai.chat child span, got ops: ${parent.spans?.map(s => s.op).join(', ')}`); assertEquals(aiSpan!.description, 'chat claude-3-5-sonnet-latest'); - assertEquals(aiSpan!.data?.['gen_ai.system'], 'anthropic'); + assertEquals(aiSpan!.data?.['gen_ai.provider.name'], 'anthropic'); assertEquals(aiSpan!.data?.['gen_ai.operation.name'], 'chat'); assertEquals(aiSpan!.data?.['gen_ai.request.model'], 'claude-3-5-sonnet-latest'); assertEquals(aiSpan!.data?.['gen_ai.response.model'], 'claude-3-5-sonnet-20241022'); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-google-genai/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-google-genai/test.ts index b7606856c6aa..db7451c570bb 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-google-genai/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-google-genai/test.ts @@ -53,7 +53,7 @@ Deno.test('google-genai instrumentation: orchestrion @google/genai:generate-cont `expected a gen_ai.generate_content child span, got ops: ${parent.spans?.map(s => s.op).join(', ')}`, ); assertEquals(aiSpan!.description, 'generate_content gemini-1.5-flash'); - assertEquals(aiSpan!.data?.['gen_ai.system'], 'google_genai'); + assertEquals(aiSpan!.data?.['gen_ai.provider.name'], 'google_genai'); assertEquals(aiSpan!.data?.['gen_ai.operation.name'], 'generate_content'); assertEquals(aiSpan!.data?.['gen_ai.request.model'], 'gemini-1.5-flash'); assertEquals(aiSpan!.data?.['gen_ai.response.model'], 'gemini-1.5-flash-002'); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-langchain/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-langchain/test.ts index 0a316f4506d2..efbfa6a5035d 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-langchain/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-langchain/test.ts @@ -48,7 +48,7 @@ Deno.test('langchain instrumentation: orchestrion @langchain/openai:embedQuery c const aiSpan = parent.spans?.find(s => s.op === 'gen_ai.embeddings'); assertExists(aiSpan, `expected a gen_ai.embeddings child span, got ops: ${parent.spans?.map(s => s.op).join(', ')}`); assertEquals(aiSpan!.description, 'embeddings text-embedding-3-small'); - assertEquals(aiSpan!.data?.['gen_ai.system'], 'openai'); + assertEquals(aiSpan!.data?.['gen_ai.provider.name'], 'openai'); assertEquals(aiSpan!.data?.['gen_ai.operation.name'], 'embeddings'); assertEquals(aiSpan!.data?.['gen_ai.request.model'], 'text-embedding-3-small'); assertEquals(aiSpan!.data?.['sentry.origin'], 'auto.ai.langchain'); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-openai/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-openai/test.ts index 70f04dbcbe57..c47726c24473 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-openai/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-openai/test.ts @@ -51,7 +51,7 @@ Deno.test('openai instrumentation: orchestrion:openai:chat channel produces a ne const aiSpan = parent.spans?.find(s => s.op === 'gen_ai.chat'); assertExists(aiSpan, `expected a gen_ai.chat child span, got ops: ${parent.spans?.map(s => s.op).join(', ')}`); assertEquals(aiSpan!.description, 'chat gpt-4o'); - assertEquals(aiSpan!.data?.['gen_ai.system'], 'openai'); + assertEquals(aiSpan!.data?.['gen_ai.provider.name'], 'openai'); assertEquals(aiSpan!.data?.['gen_ai.operation.name'], 'chat'); assertEquals(aiSpan!.data?.['gen_ai.request.model'], 'gpt-4o'); assertEquals(aiSpan!.data?.['gen_ai.response.model'], 'gpt-4o-2024-08-06'); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-vercel-ai/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-vercel-ai/test.ts index 14baf6c44df3..642020b26075 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-vercel-ai/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-vercel-ai/test.ts @@ -53,7 +53,7 @@ Deno.test('vercel-ai instrumentation: orchestrion:ai:generateText channel produc `expected a gen_ai.invoke_agent child span, got ops: ${parent.spans?.map(s => s.op).join(', ')}`, ); assertEquals(aiSpan!.description, 'invoke_agent'); - assertEquals(aiSpan!.data?.['gen_ai.system'], 'openai'); + assertEquals(aiSpan!.data?.['gen_ai.provider.name'], 'openai'); assertEquals(aiSpan!.data?.['gen_ai.operation.name'], 'invoke_agent'); assertEquals(aiSpan!.data?.['gen_ai.request.model'], 'gpt-4o'); assertEquals(aiSpan!.data?.['vercel.ai.operationId'], 'ai.generateText'); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/anthropic.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/anthropic.test.ts index b9370f53abc4..781be1f8dc11 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/anthropic.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/anthropic.test.ts @@ -16,7 +16,7 @@ test('Instruments anthropic-ai automatically via orchestrion', async ({ baseURL expect(chatSpan).toBeDefined(); expect(chatSpan?.attributes['sentry.op']?.value).toBe('gen_ai.chat'); expect(chatSpan?.attributes['sentry.origin']?.value).toBe('auto.ai.anthropic'); - expect(chatSpan?.attributes['gen_ai.system']?.value).toBe('anthropic'); + expect(chatSpan?.attributes['gen_ai.provider.name']?.value).toBe('anthropic'); expect(chatSpan?.attributes['gen_ai.request.model']?.value).toBe('claude-3-haiku-20240307'); expect(chatSpan?.attributes['gen_ai.usage.input_tokens']?.value).toBe(10); expect(chatSpan?.attributes['gen_ai.usage.output_tokens']?.value).toBe(15); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/google-genai.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/google-genai.test.ts index f508f5c91f56..820038d5f43c 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/google-genai.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/google-genai.test.ts @@ -16,7 +16,7 @@ test('Instruments google-genai automatically via orchestrion', async ({ baseURL expect(generateSpan).toBeDefined(); expect(generateSpan?.attributes['sentry.op']?.value).toBe('gen_ai.generate_content'); expect(generateSpan?.attributes['sentry.origin']?.value).toBe('auto.ai.google_genai'); - expect(generateSpan?.attributes['gen_ai.system']?.value).toBe('google_genai'); + expect(generateSpan?.attributes['gen_ai.provider.name']?.value).toBe('google_genai'); expect(generateSpan?.attributes['gen_ai.request.model']?.value).toBe('gemini-1.5-flash'); expect(generateSpan?.attributes['gen_ai.usage.input_tokens']?.value).toBe(8); expect(generateSpan?.attributes['gen_ai.usage.output_tokens']?.value).toBe(12); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/openai.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/openai.test.ts index 12a99e6f559e..6d7b7019d084 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/openai.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/openai.test.ts @@ -16,7 +16,7 @@ test('Instruments openai automatically via orchestrion', async ({ baseURL }) => expect(chatSpan).toBeDefined(); expect(chatSpan?.attributes['sentry.op']?.value).toBe('gen_ai.chat'); expect(chatSpan?.attributes['sentry.origin']?.value).toBe('auto.ai.openai'); - expect(chatSpan?.attributes['gen_ai.system']?.value).toBe('openai'); + expect(chatSpan?.attributes['gen_ai.provider.name']?.value).toBe('openai'); expect(chatSpan?.attributes['gen_ai.request.model']?.value).toBe('gpt-3.5-turbo'); expect(chatSpan?.attributes['gen_ai.usage.input_tokens']?.value).toBe(10); expect(chatSpan?.attributes['gen_ai.usage.output_tokens']?.value).toBe(15); diff --git a/dev-packages/node-integration-tests/suites/aws-serverless/bedrock/test.ts b/dev-packages/node-integration-tests/suites/aws-serverless/bedrock/test.ts index 8eded827abb3..0a4f575ebb7e 100644 --- a/dev-packages/node-integration-tests/suites/aws-serverless/bedrock/test.ts +++ b/dev-packages/node-integration-tests/suites/aws-serverless/bedrock/test.ts @@ -23,7 +23,7 @@ function assertBedrockSpans(transaction: TransactionEvent): void { status: 'ok', data: expect.objectContaining({ 'sentry.origin': ORIGIN, - 'gen_ai.system': 'aws.bedrock', + 'gen_ai.provider.name': 'aws.bedrock', 'gen_ai.operation.name': 'chat', 'gen_ai.request.model': MODEL_ID, 'gen_ai.request.max_tokens': 100, @@ -43,7 +43,7 @@ function assertBedrockSpans(transaction: TransactionEvent): void { status: 'ok', data: expect.objectContaining({ 'sentry.origin': ORIGIN, - 'gen_ai.system': 'aws.bedrock', + 'gen_ai.provider.name': 'aws.bedrock', 'gen_ai.request.model': MODEL_ID, 'gen_ai.request.max_tokens': 100, 'gen_ai.request.temperature': 0.5, diff --git a/dev-packages/node-integration-tests/suites/tracing/anthropic/test.ts b/dev-packages/node-integration-tests/suites/tracing/anthropic/test.ts index b332f982d997..33ec4221f831 100644 --- a/dev-packages/node-integration-tests/suites/tracing/anthropic/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/anthropic/test.ts @@ -2,6 +2,7 @@ import { afterAll, describe, expect } from 'vitest'; import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, @@ -12,7 +13,6 @@ import { GEN_AI_RESPONSE_STREAMING, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -177,7 +177,7 @@ describe('Anthropic integration', () => { expect(completionSpan!.attributes[GEN_AI_INPUT_MESSAGES].value).toBe( '[{"role":"user","content":"What is the capital of France?"}]', ); - expect(completionSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(completionSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(completionSpan!.attributes[GEN_AI_USAGE_INPUT_TOKENS].value).toBe(10); expect(completionSpan!.attributes[GEN_AI_USAGE_OUTPUT_TOKENS].value).toBe(15); expect(completionSpan!.attributes[GEN_AI_USAGE_TOTAL_TOKENS].value).toBe(25); @@ -273,7 +273,7 @@ describe('Anthropic integration', () => { expect(modelsSpan!.status).toBe('ok'); expect(modelsSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('models'); expect(modelsSpan!.attributes['sentry.op'].value).toBe('gen_ai.models'); - expect(modelsSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(modelsSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(modelsSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-haiku-20240307'); expect(modelsSpan!.attributes[GEN_AI_RESPONSE_ID].value).toBe('claude-3-haiku-20240307'); expect(modelsSpan!.attributes[GEN_AI_RESPONSE_MODEL].value).toBe('claude-3-haiku-20240307'); @@ -325,7 +325,7 @@ describe('Anthropic integration', () => { span => span.attributes[GEN_AI_RESPONSE_FINISH_REASONS]?.value === '["end_turn"]', ); expect(detailedStreamSpan).toBeDefined(); - expect(detailedStreamSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(detailedStreamSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(detailedStreamSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); expect(detailedStreamSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-haiku-20240307'); expect(detailedStreamSpan!.attributes[GEN_AI_RESPONSE_MODEL].value).toBe('claude-3-haiku-20240307'); @@ -339,7 +339,7 @@ describe('Anthropic integration', () => { expect(messagesStreamSpan).toBeDefined(); expect(messagesStreamSpan!.name).toBe('chat claude-3-haiku-20240307'); expect(messagesStreamSpan!.status).toBe('ok'); - expect(messagesStreamSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(messagesStreamSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(messagesStreamSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); expect(messagesStreamSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-haiku-20240307'); expect(messagesStreamSpan!.attributes[GEN_AI_RESPONSE_STREAMING].value).toBe(true); @@ -622,7 +622,7 @@ describe('Anthropic integration', () => { expect(truncatedSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); expect(truncatedSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(truncatedSpan!.attributes['sentry.origin'].value).toBe('auto.ai.anthropic'); - expect(truncatedSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(truncatedSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(truncatedSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-haiku-20240307'); const smallMessageSpan = container.items.find( @@ -634,7 +634,7 @@ describe('Anthropic integration', () => { expect(smallMessageSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); expect(smallMessageSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(smallMessageSpan!.attributes['sentry.origin'].value).toBe('auto.ai.anthropic'); - expect(smallMessageSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(smallMessageSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(smallMessageSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-haiku-20240307'); }, }) @@ -684,7 +684,7 @@ describe('Anthropic integration', () => { expect(firstSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); expect(firstSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(firstSpan!.attributes['sentry.origin'].value).toBe('auto.ai.anthropic'); - expect(firstSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(firstSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(firstSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-haiku-20240307'); }, }) diff --git a/dev-packages/node-integration-tests/suites/tracing/google-genai/test.ts b/dev-packages/node-integration-tests/suites/tracing/google-genai/test.ts index 9f61c8a127e4..0e195be2f668 100644 --- a/dev-packages/node-integration-tests/suites/tracing/google-genai/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/google-genai/test.ts @@ -3,6 +3,7 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, @@ -14,7 +15,6 @@ import { GEN_AI_RESPONSE_STREAMING, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -50,7 +50,7 @@ describe('Google GenAI integration', () => { expect(chatSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(chatSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); expect(chatSpan!.attributes['sentry.origin'].value).toBe(EXPECTED_ORIGIN); - expect(chatSpan!.attributes[GEN_AI_SYSTEM].value).toBe('google_genai'); + expect(chatSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('google_genai'); expect(chatSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('gemini-1.5-pro'); expect(chatSpan!.attributes[GEN_AI_USAGE_INPUT_TOKENS].value).toBe(8); expect(chatSpan!.attributes[GEN_AI_USAGE_OUTPUT_TOKENS].value).toBe(12); @@ -61,7 +61,7 @@ describe('Google GenAI integration', () => { expect(generateContentSpan!.status).toBe('ok'); expect(generateContentSpan!.attributes['sentry.op'].value).toBe('gen_ai.generate_content'); expect(generateContentSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('generate_content'); - expect(generateContentSpan!.attributes[GEN_AI_SYSTEM].value).toBe('google_genai'); + expect(generateContentSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('google_genai'); expect(generateContentSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('gemini-1.5-flash'); expect(generateContentSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(generateContentSpan!.attributes[GEN_AI_REQUEST_TOP_P].value).toBe(0.9); @@ -75,7 +75,7 @@ describe('Google GenAI integration', () => { expect(errorSpan!.status).toBe('error'); expect(errorSpan!.attributes['sentry.op'].value).toBe('gen_ai.generate_content'); expect(errorSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('generate_content'); - expect(errorSpan!.attributes[GEN_AI_SYSTEM].value).toBe('google_genai'); + expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('google_genai'); expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model'); }, }) @@ -103,7 +103,7 @@ describe('Google GenAI integration', () => { expect(chatSpan!.status).toBe('ok'); expect(chatSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(chatSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); - expect(chatSpan!.attributes[GEN_AI_SYSTEM].value).toBe('google_genai'); + expect(chatSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('google_genai'); expect(chatSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('gemini-1.5-pro'); expect(chatSpan!.attributes[GEN_AI_INPUT_MESSAGES]).toBeDefined(); expect(chatSpan!.attributes[GEN_AI_RESPONSE_TEXT]).toBeDefined(); @@ -438,7 +438,7 @@ describe('Google GenAI integration', () => { expect(span.attributes['sentry.op'].value).toBe('gen_ai.embeddings'); expect(span.attributes[GEN_AI_OPERATION_NAME].value).toBe('embeddings'); expect(span.attributes['sentry.origin'].value).toBe(EXPECTED_ORIGIN); - expect(span.attributes[GEN_AI_SYSTEM].value).toBe('google_genai'); + expect(span.attributes[GEN_AI_PROVIDER_NAME].value).toBe('google_genai'); expect(span.attributes[GEN_AI_REQUEST_MODEL].value).toBe('text-embedding-004'); expect(span.attributes[GEN_AI_EMBEDDINGS_INPUT]).toBeUndefined(); } @@ -476,7 +476,7 @@ describe('Google GenAI integration', () => { expect(stringInputSpan!.name).toBe('embeddings text-embedding-004'); expect(stringInputSpan!.status).toBe('ok'); expect(stringInputSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('embeddings'); - expect(stringInputSpan!.attributes[GEN_AI_SYSTEM].value).toBe('google_genai'); + expect(stringInputSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('google_genai'); const errorSpan = container.items.find( span => span.attributes[GEN_AI_EMBEDDINGS_INPUT]?.value === 'This will fail', diff --git a/dev-packages/node-integration-tests/suites/tracing/langchain/test.ts b/dev-packages/node-integration-tests/suites/tracing/langchain/test.ts index e03769f462c4..7a83e434bc7e 100644 --- a/dev-packages/node-integration-tests/suites/tracing/langchain/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/langchain/test.ts @@ -3,6 +3,7 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, @@ -11,7 +12,6 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -51,7 +51,7 @@ describe('LangChain integration', () => { expect(sonnetSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(sonnetSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); expect(sonnetSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); - expect(sonnetSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(sonnetSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-5-sonnet-20241022'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MAX_TOKENS].value).toBe(100); @@ -67,7 +67,7 @@ describe('LangChain integration', () => { expect(opusSpan!.status).toBe('ok'); expect(opusSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(opusSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(opusSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(opusSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(opusSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-opus-20240229'); expect(opusSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.9); expect(opusSpan!.attributes[GEN_AI_REQUEST_TOP_P].value).toBe(0.95); @@ -81,7 +81,7 @@ describe('LangChain integration', () => { expect(errorSpan!.status).toBe('error'); expect(errorSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(errorSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(errorSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model'); }, }) @@ -128,7 +128,7 @@ describe('LangChain integration', () => { expect(sonnetSpan!.status).toBe('ok'); expect(sonnetSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(sonnetSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(sonnetSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(sonnetSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-5-sonnet-20241022'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MAX_TOKENS].value).toBe(100); @@ -144,7 +144,7 @@ describe('LangChain integration', () => { const opusSpan = container.items.find(span => span.name === 'chat claude-3-opus-20240229'); expect(opusSpan).toBeDefined(); expect(opusSpan!.status).toBe('ok'); - expect(opusSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(opusSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(opusSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-opus-20240229'); expect(opusSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.9); expect(opusSpan!.attributes[GEN_AI_REQUEST_TOP_P].value).toBe(0.95); @@ -158,7 +158,7 @@ describe('LangChain integration', () => { const errorSpan = container.items.find(span => span.name === 'chat error-model'); expect(errorSpan).toBeDefined(); expect(errorSpan!.status).toBe('error'); - expect(errorSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model'); expect(errorSpan!.attributes[GEN_AI_INPUT_MESSAGES]).toBeDefined(); }, @@ -183,7 +183,7 @@ describe('LangChain integration', () => { expect(firstSpan!.status).toBe('ok'); expect(firstSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(firstSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(firstSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(firstSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(firstSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-5-sonnet-20241022'); expect(firstSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(firstSpan!.attributes[GEN_AI_REQUEST_MAX_TOKENS].value).toBe(150); @@ -375,7 +375,7 @@ describe('LangChain integration', () => { expect(span.attributes['sentry.op'].value).toBe(GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE); expect(span.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); expect(span.attributes[GEN_AI_OPERATION_NAME].value).toBe('embeddings'); - expect(span.attributes[GEN_AI_SYSTEM].value).toBe('openai'); + expect(span.attributes[GEN_AI_PROVIDER_NAME].value).toBe('openai'); expect(span.attributes[GEN_AI_REQUEST_MODEL].value).toBe('text-embedding-3-small'); expect(span.attributes[GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE].value).toBe(1536); } @@ -384,7 +384,7 @@ describe('LangChain integration', () => { expect(errorSpan).toBeDefined(); expect(errorSpan!.status).toBe('error'); expect(errorSpan!.attributes['sentry.op'].value).toBe(GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE); - expect(errorSpan!.attributes[GEN_AI_SYSTEM].value).toBe('openai'); + expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('openai'); }, }) .start() diff --git a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts index be472373c19e..586384a1320a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts @@ -2,6 +2,7 @@ import { afterAll, expect } from 'vitest'; import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, @@ -10,7 +11,6 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -52,7 +52,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(sonnetSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(sonnetSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); expect(sonnetSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); - expect(sonnetSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(sonnetSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-5-sonnet-20241022'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MAX_TOKENS].value).toBe(100); @@ -68,7 +68,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(opusSpan!.status).toBe('ok'); expect(opusSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(opusSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(opusSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(opusSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(opusSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-opus-20240229'); expect(opusSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.9); expect(opusSpan!.attributes[GEN_AI_REQUEST_TOP_P].value).toBe(0.95); @@ -82,7 +82,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(errorSpan!.status).toBe('error'); expect(errorSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(errorSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(errorSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model'); }, }) @@ -122,7 +122,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(sonnetSpan!.status).toBe('ok'); expect(sonnetSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(sonnetSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(sonnetSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(sonnetSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-5-sonnet-20241022'); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(sonnetSpan!.attributes[GEN_AI_REQUEST_MAX_TOKENS].value).toBe(100); @@ -138,7 +138,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { const opusSpan = container.items.find(span => span.name === 'chat claude-3-opus-20240229'); expect(opusSpan).toBeDefined(); expect(opusSpan!.status).toBe('ok'); - expect(opusSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(opusSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(opusSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-opus-20240229'); expect(opusSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.9); expect(opusSpan!.attributes[GEN_AI_REQUEST_TOP_P].value).toBe(0.95); @@ -152,7 +152,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { const errorSpan = container.items.find(span => span.name === 'chat error-model'); expect(errorSpan).toBeDefined(); expect(errorSpan!.status).toBe('error'); - expect(errorSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model'); expect(errorSpan!.attributes[GEN_AI_INPUT_MESSAGES]).toBeDefined(); }, @@ -189,7 +189,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(firstSpan!.status).toBe('ok'); expect(firstSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(firstSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(firstSpan!.attributes[GEN_AI_SYSTEM].value).toBe('anthropic'); + expect(firstSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic'); expect(firstSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('claude-3-5-sonnet-20241022'); expect(firstSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(firstSpan!.attributes[GEN_AI_REQUEST_MAX_TOKENS].value).toBe(150); @@ -338,7 +338,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(gpt4oSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(gpt4oSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); expect(gpt4oSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('chat'); - expect(gpt4oSpan!.attributes[GEN_AI_SYSTEM].value).toBe('openai'); + expect(gpt4oSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('openai'); expect(gpt4oSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('gpt-4o'); expect(gpt4oSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.7); expect(gpt4oSpan!.attributes[GEN_AI_REQUEST_MAX_TOKENS].value).toBe(100); @@ -354,7 +354,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(gpt35Span!.status).toBe('ok'); expect(gpt35Span!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(gpt35Span!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(gpt35Span!.attributes[GEN_AI_SYSTEM].value).toBe('openai'); + expect(gpt35Span!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('openai'); expect(gpt35Span!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('gpt-3.5-turbo'); expect(gpt35Span!.attributes[GEN_AI_REQUEST_TEMPERATURE].value).toBe(0.5); expect(gpt35Span!.attributes[GEN_AI_USAGE_INPUT_TOKENS].value).toBe(8); @@ -368,7 +368,7 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { expect(errorSpan!.status).toBe('error'); expect(errorSpan!.attributes['sentry.op'].value).toBe('gen_ai.chat'); expect(errorSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain'); - expect(errorSpan!.attributes[GEN_AI_SYSTEM].value).toBe('openai'); + expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('openai'); expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model'); }, }) diff --git a/dev-packages/node-integration-tests/suites/tracing/openai/openai-tool-calls/test.ts b/dev-packages/node-integration-tests/suites/tracing/openai/openai-tool-calls/test.ts index c7c3e5614166..365c4d68cb32 100644 --- a/dev-packages/node-integration-tests/suites/tracing/openai/openai-tool-calls/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/openai/openai-tool-calls/test.ts @@ -3,6 +3,7 @@ import { afterAll, describe, expect } from 'vitest'; import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_FINISH_REASONS, @@ -11,7 +12,6 @@ import { GEN_AI_RESPONSE_STREAMING, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, GEN_AI_USAGE_TOTAL_TOKENS, @@ -101,7 +101,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(chatToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ type: 'string', value: 'openai' }); + expect(chatToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai' }); expect(chatToolsSpan!.attributes[GEN_AI_REQUEST_MODEL]).toEqual({ type: 'string', value: 'gpt-4', @@ -153,7 +153,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingChatToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingChatToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -216,7 +216,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(responsesToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(responsesToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -272,7 +272,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingResponsesToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingResponsesToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -349,7 +349,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(chatToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ type: 'string', value: 'openai' }); + expect(chatToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai' }); expect(chatToolsSpan!.attributes[GEN_AI_REQUEST_MODEL]).toEqual({ type: 'string', value: 'gpt-4', @@ -413,7 +413,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingChatToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingChatToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -484,7 +484,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(responsesToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(responsesToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -548,7 +548,7 @@ describe('OpenAI Tool Calls integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingResponsesToolsSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingResponsesToolsSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); diff --git a/dev-packages/node-integration-tests/suites/tracing/openai/test.ts b/dev-packages/node-integration-tests/suites/tracing/openai/test.ts index 66f03e3ca06e..e352450fb939 100644 --- a/dev-packages/node-integration-tests/suites/tracing/openai/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/openai/test.ts @@ -5,6 +5,7 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_RESPONSE_FINISH_REASONS, @@ -12,7 +13,6 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_STREAMING, GEN_AI_RESPONSE_TEXT, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -57,7 +57,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(chatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(chatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -112,7 +112,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(responsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ type: 'string', value: 'openai' }); + expect(responsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai' }); expect(responsesSpan!.attributes[GEN_AI_REQUEST_MODEL]).toEqual({ type: 'string', value: 'gpt-3.5-turbo', @@ -162,7 +162,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(nonStreamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(nonStreamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -189,7 +189,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingChatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingChatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -252,7 +252,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingResponsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingResponsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -312,7 +312,7 @@ describe('OpenAI integration', () => { type: 'boolean', value: true, }); - expect(streamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -357,7 +357,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(chatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(chatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -424,7 +424,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(responsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ type: 'string', value: 'openai' }); + expect(responsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai' }); expect(responsesSpan!.attributes[GEN_AI_REQUEST_MODEL]).toEqual({ type: 'string', value: 'gpt-3.5-turbo', @@ -482,7 +482,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(nonStreamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(nonStreamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -513,7 +513,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingChatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingChatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -588,7 +588,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingResponsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingResponsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -660,7 +660,7 @@ describe('OpenAI integration', () => { type: 'string', value: '[{"role":"user","content":"This will fail"}]', }); - expect(streamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -811,7 +811,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(singleEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(singleEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -856,7 +856,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(errorEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(errorEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -885,7 +885,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(multiEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(multiEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -942,7 +942,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(singleEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(singleEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -993,7 +993,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(errorEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(errorEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1026,7 +1026,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(multiEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(multiEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1077,7 +1077,7 @@ describe('OpenAI integration', () => { [GEN_AI_OPERATION_NAME]: 'chat', [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'gen_ai.chat', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai', - [GEN_AI_SYSTEM]: 'openai', + [GEN_AI_PROVIDER_NAME]: 'openai', [GEN_AI_REQUEST_MODEL]: 'gpt-3.5-turbo', [GEN_AI_REQUEST_TEMPERATURE]: 0.7, [GEN_AI_RESPONSE_MODEL]: 'gpt-3.5-turbo', @@ -1119,7 +1119,7 @@ describe('OpenAI integration', () => { [GEN_AI_OPERATION_NAME]: 'chat', [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'gen_ai.chat', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai', - [GEN_AI_SYSTEM]: 'openai', + [GEN_AI_PROVIDER_NAME]: 'openai', [GEN_AI_REQUEST_MODEL]: 'gpt-3.5-turbo', [GEN_AI_REQUEST_TEMPERATURE]: 0.7, [GEN_AI_RESPONSE_MODEL]: 'gpt-3.5-turbo', @@ -1177,7 +1177,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(truncatedMessageSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(truncatedMessageSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1212,7 +1212,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(smallMessageSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(smallMessageSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1267,7 +1267,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(firstSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ type: 'string', value: 'openai' }); + expect(firstSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai' }); expect(firstSpan!.attributes[GEN_AI_REQUEST_MODEL]).toEqual({ type: 'string', value: 'gpt-3.5-turbo', @@ -1310,7 +1310,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(conversationCreateSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(conversationCreateSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1339,7 +1339,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(conversationResponseSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(conversationResponseSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1382,7 +1382,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'auto.ai.openai', }); - expect(previousResponseSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(previousResponseSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1423,7 +1423,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'user_chat_session_abc123', }); - expect(span!.attributes['gen_ai.system']).toEqual({ type: 'string', value: 'openai' }); + expect(span!.attributes['gen_ai.provider.name']).toEqual({ type: 'string', value: 'openai' }); expect(span!.attributes['gen_ai.request.model']).toEqual({ type: 'string', value: 'gpt-4' }); expect(span!.attributes['gen_ai.operation.name']).toEqual({ type: 'string', value: 'chat' }); expect(span!.attributes['sentry.op']).toEqual({ type: 'string', value: 'gen_ai.chat' }); @@ -1456,7 +1456,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'conv_user1_session_abc', }); - expect(span!.attributes['gen_ai.system']).toEqual({ type: 'string', value: 'openai' }); + expect(span!.attributes['gen_ai.provider.name']).toEqual({ type: 'string', value: 'openai' }); expect(span!.attributes['gen_ai.request.model']).toEqual({ type: 'string', value: 'gpt-4' }); expect(span!.attributes['sentry.op']).toEqual({ type: 'string', value: 'gen_ai.chat' }); } @@ -1488,7 +1488,7 @@ describe('OpenAI integration', () => { type: 'string', value: 'conv_user2_session_xyz', }); - expect(span!.attributes['gen_ai.system']).toEqual({ type: 'string', value: 'openai' }); + expect(span!.attributes['gen_ai.provider.name']).toEqual({ type: 'string', value: 'openai' }); expect(span!.attributes['gen_ai.request.model']).toEqual({ type: 'string', value: 'gpt-4' }); expect(span!.attributes['sentry.op']).toEqual({ type: 'string', value: 'gen_ai.chat' }); } diff --git a/dev-packages/node-integration-tests/suites/tracing/openai/v6/test.ts b/dev-packages/node-integration-tests/suites/tracing/openai/v6/test.ts index 5ec25a0bb47a..b92ad82bda83 100644 --- a/dev-packages/node-integration-tests/suites/tracing/openai/v6/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/openai/v6/test.ts @@ -4,6 +4,7 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_RESPONSE_FINISH_REASONS, @@ -11,7 +12,6 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_STREAMING, GEN_AI_RESPONSE_TEXT, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -59,7 +59,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(chatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(chatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -114,7 +114,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(responsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ type: 'string', value: 'openai' }); + expect(responsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai' }); expect(responsesSpan!.attributes[GEN_AI_REQUEST_MODEL]).toEqual({ type: 'string', value: 'gpt-3.5-turbo', @@ -164,7 +164,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(nonStreamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(nonStreamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -191,7 +191,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingChatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingChatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -254,7 +254,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingResponsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingResponsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -314,7 +314,7 @@ describe('OpenAI integration (V6)', () => { type: 'boolean', value: true, }); - expect(streamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -369,7 +369,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(chatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(chatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -436,7 +436,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(responsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ type: 'string', value: 'openai' }); + expect(responsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai' }); expect(responsesSpan!.attributes[GEN_AI_REQUEST_MODEL]).toEqual({ type: 'string', value: 'gpt-3.5-turbo', @@ -494,7 +494,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(nonStreamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(nonStreamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -525,7 +525,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingChatCompletionSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingChatCompletionSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -600,7 +600,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(streamingResponsesSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingResponsesSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -672,7 +672,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: '[{"role":"user","content":"This will fail"}]', }); - expect(streamingErrorSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(streamingErrorSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -796,7 +796,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(singleEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(singleEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -841,7 +841,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(errorEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(errorEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -870,7 +870,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(multiEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(multiEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -937,7 +937,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(singleEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(singleEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -988,7 +988,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(errorEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(errorEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1021,7 +1021,7 @@ describe('OpenAI integration (V6)', () => { type: 'string', value: 'auto.ai.openai', }); - expect(multiEmbeddingSpan!.attributes[GEN_AI_SYSTEM]).toEqual({ + expect(multiEmbeddingSpan!.attributes[GEN_AI_PROVIDER_NAME]).toEqual({ type: 'string', value: 'openai', }); @@ -1082,7 +1082,7 @@ describe('OpenAI integration (V6)', () => { [GEN_AI_OPERATION_NAME]: 'chat', [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'gen_ai.chat', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai', - [GEN_AI_SYSTEM]: 'openai', + [GEN_AI_PROVIDER_NAME]: 'openai', [GEN_AI_REQUEST_MODEL]: 'gpt-3.5-turbo', [GEN_AI_REQUEST_TEMPERATURE]: 0.7, [GEN_AI_RESPONSE_MODEL]: 'gpt-3.5-turbo', @@ -1135,7 +1135,7 @@ describe('OpenAI integration (V6)', () => { [GEN_AI_OPERATION_NAME]: 'chat', [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'gen_ai.chat', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai', - [GEN_AI_SYSTEM]: 'openai', + [GEN_AI_PROVIDER_NAME]: 'openai', [GEN_AI_REQUEST_MODEL]: 'gpt-3.5-turbo', [GEN_AI_REQUEST_TEMPERATURE]: 0.7, [GEN_AI_RESPONSE_MODEL]: 'gpt-3.5-turbo', diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts index ca28f11c3305..5a9eb127d1d2 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts @@ -5,10 +5,10 @@ import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, GEN_AI_OUTPUT_MESSAGES, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_TOOL_DESCRIPTION, GEN_AI_TOOL_INPUT, @@ -71,7 +71,7 @@ describe('Vercel AI integration (v4)', () => { expect(firstGenerateContentSpan!.attributes['vercel.ai.operationId'].value).toBe( 'ai.generateText.doGenerate', ); - expect(firstGenerateContentSpan!.attributes[GEN_AI_SYSTEM].value).toBe('mock-provider'); + expect(firstGenerateContentSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('mock-provider'); expect(firstGenerateContentSpan!.attributes[GEN_AI_USAGE_INPUT_TOKENS].value).toBe(10); expect(firstGenerateContentSpan!.attributes[GEN_AI_INPUT_MESSAGES]).toBeUndefined(); @@ -711,7 +711,7 @@ describe('Vercel AI integration (v4)', () => { expect(generateContentSpan!.attributes['vercel.ai.operationId'].value).toBe('ai.generateObject.doGenerate'); expect(generateContentSpan!.attributes['sentry.origin'].value).toBe(expectedOrigin); expect(generateContentSpan!.attributes['gen_ai.operation.name'].value).toBe('generate_content'); - expect(generateContentSpan!.attributes['gen_ai.system'].value).toBe('mock-provider'); + expect(generateContentSpan!.attributes['gen_ai.provider.name'].value).toBe('mock-provider'); expect(generateContentSpan!.attributes['gen_ai.request.model'].value).toBe('mock-model-id'); expect(generateContentSpan!.attributes['gen_ai.response.model'].value).toBe('mock-model-id'); expect(generateContentSpan!.attributes['gen_ai.usage.input_tokens'].value).toBe(15); diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts index 37809bc4eeef..706cb5e0ba15 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/v5/test.ts @@ -3,10 +3,10 @@ import { afterAll, describe, expect } from 'vitest'; import { GEN_AI_INPUT_MESSAGES, GEN_AI_OUTPUT_MESSAGES, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, - GEN_AI_SYSTEM, GEN_AI_TOOL_DESCRIPTION, GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, @@ -72,7 +72,7 @@ describe('Vercel AI integration (v5)', () => { expect(firstGenerateContentSpan!.attributes['vercel.ai.operationId'].value).toBe( 'ai.generateText.doGenerate', ); - expect(firstGenerateContentSpan!.attributes[GEN_AI_SYSTEM].value).toBe('mock-provider'); + expect(firstGenerateContentSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('mock-provider'); expect(firstGenerateContentSpan!.attributes[GEN_AI_USAGE_INPUT_TOKENS].value).toBe(10); expect(firstGenerateContentSpan!.attributes[GEN_AI_INPUT_MESSAGES]).toBeUndefined(); diff --git a/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts b/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts index 4803ce795370..4be1beeb3ab4 100644 --- a/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts @@ -5,11 +5,11 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OUTPUT_MESSAGES, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_FINISH_REASONS, GEN_AI_RESPONSE_MODEL, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_TOOL_DESCRIPTION, GEN_AI_TOOL_INPUT, @@ -213,7 +213,7 @@ describe.each(matrix)('Vercel AI integration (version %s)', (version, vercelAiVe expect(firstGenerateContentSpan.attributes['vercel.ai.operationId']?.value).toBe( 'ai.generateText.doGenerate', ); - expect(firstGenerateContentSpan.attributes[GEN_AI_SYSTEM]?.value).toBe('mock-provider'); + expect(firstGenerateContentSpan.attributes[GEN_AI_PROVIDER_NAME]?.value).toBe('mock-provider'); expect(firstGenerateContentSpan.attributes[GEN_AI_USAGE_INPUT_TOKENS]?.value).toBe(10); expect(firstGenerateContentSpan.attributes[GEN_AI_INPUT_MESSAGES]).toBeUndefined(); diff --git a/packages/core/src/tracing/anthropic-ai/index.ts b/packages/core/src/tracing/anthropic-ai/index.ts index 00e638c6e516..dc47c5f80a86 100644 --- a/packages/core/src/tracing/anthropic-ai/index.ts +++ b/packages/core/src/tracing/anthropic-ai/index.ts @@ -7,6 +7,7 @@ import type { Span, SpanAttributeValue } from '../../types/span'; import { GEN_AI_OPERATION_NAME, GEN_AI_PROMPT, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_FREQUENCY_PENALTY, GEN_AI_REQUEST_MAX_TOKENS, @@ -18,7 +19,6 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, } from '@sentry/conventions/attributes'; import { GEN_AI_REQUEST_STREAM_ATTRIBUTE } from '../ai/gen-ai-attributes'; import type { InstrumentedMethodEntry } from '../ai/utils'; @@ -51,7 +51,7 @@ export function extractRequestAttributes( operationName: string, ): Record { const attributes: Record = { - [GEN_AI_SYSTEM]: 'anthropic', + [GEN_AI_PROVIDER_NAME]: 'anthropic', [GEN_AI_OPERATION_NAME]: operationName, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.anthropic', }; diff --git a/packages/core/src/tracing/google-genai/index.ts b/packages/core/src/tracing/google-genai/index.ts index 384c42477dca..22dfb179b19d 100644 --- a/packages/core/src/tracing/google-genai/index.ts +++ b/packages/core/src/tracing/google-genai/index.ts @@ -10,6 +10,7 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_FREQUENCY_PENALTY, GEN_AI_REQUEST_MAX_TOKENS, @@ -21,7 +22,6 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, @@ -107,7 +107,7 @@ export function extractRequestAttributes( context?: unknown, ): Record { const attributes: Record = { - [GEN_AI_SYSTEM]: GOOGLE_GENAI_SYSTEM_NAME, + [GEN_AI_PROVIDER_NAME]: GOOGLE_GENAI_SYSTEM_NAME, [GEN_AI_OPERATION_NAME]: operationName, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.google_genai', }; diff --git a/packages/core/src/tracing/langchain/embeddings.ts b/packages/core/src/tracing/langchain/embeddings.ts index 1ace6eaa4de2..fe6fac2c7a9a 100644 --- a/packages/core/src/tracing/langchain/embeddings.ts +++ b/packages/core/src/tracing/langchain/embeddings.ts @@ -1,4 +1,3 @@ -/* eslint-disable typescript-eslint/no-deprecated */ import { captureException } from '../../exports'; import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes'; import { startSpan } from '../../tracing/trace'; @@ -6,8 +5,8 @@ import type { SpanAttributeValue } from '../../types/span'; import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, - GEN_AI_SYSTEM, } from '@sentry/conventions/attributes'; import { GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE, @@ -47,7 +46,7 @@ function extractEmbeddingAttributes(instance: unknown): Record [GEN_AI_REQUEST_MODEL]: embeddingsInstance.model ?? 'unknown', }; - attributes[GEN_AI_SYSTEM] = inferSystemFromInstance(embeddingsInstance); + attributes[GEN_AI_PROVIDER_NAME] = inferSystemFromInstance(embeddingsInstance); if ('dimensions' in embeddingsInstance) { attributes[GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE] = embeddingsInstance.dimensions; } diff --git a/packages/core/src/tracing/langchain/utils.ts b/packages/core/src/tracing/langchain/utils.ts index a48dc2a536be..30d63cde9372 100644 --- a/packages/core/src/tracing/langchain/utils.ts +++ b/packages/core/src/tracing/langchain/utils.ts @@ -6,6 +6,7 @@ import { GEN_AI_AGENT_NAME, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_FREQUENCY_PENALTY, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, @@ -17,7 +18,6 @@ import { GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_TEXT, GEN_AI_RESPONSE_TOOL_CALLS, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS, GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS, @@ -257,7 +257,7 @@ function baseRequestAttributes( langSmithMetadata?: Record, ): Record { return { - [GEN_AI_SYSTEM]: stringify(system ?? 'langchain', String), + [GEN_AI_PROVIDER_NAME]: stringify(system ?? 'langchain', String), [GEN_AI_OPERATION_NAME]: 'chat', [GEN_AI_REQUEST_MODEL]: stringify(modelName, String), [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: LANGCHAIN_ORIGIN, diff --git a/packages/core/src/tracing/openai/index.ts b/packages/core/src/tracing/openai/index.ts index f4c9122aa024..66ccdd5b6363 100644 --- a/packages/core/src/tracing/openai/index.ts +++ b/packages/core/src/tracing/openai/index.ts @@ -10,9 +10,9 @@ import { GEN_AI_EMBEDDINGS_INPUT, GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MODEL, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, } from '@sentry/conventions/attributes'; import type { InstrumentedMethodEntry } from '../ai/utils'; @@ -58,7 +58,7 @@ function extractAvailableTools(params: Record): string | undefi */ export function extractRequestAttributes(args: unknown[], operationName: string): Record { const attributes: Record = { - [GEN_AI_SYSTEM]: 'openai', + [GEN_AI_PROVIDER_NAME]: 'openai', [GEN_AI_OPERATION_NAME]: operationName, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai', }; diff --git a/packages/core/src/tracing/vercel-ai/index.ts b/packages/core/src/tracing/vercel-ai/index.ts index 458077e40ccd..a80f689e21da 100644 --- a/packages/core/src/tracing/vercel-ai/index.ts +++ b/packages/core/src/tracing/vercel-ai/index.ts @@ -15,6 +15,7 @@ import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, GEN_AI_OUTPUT_MESSAGES, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_MODEL, GEN_AI_TOOL_DESCRIPTION, @@ -322,6 +323,7 @@ export function processVercelAiSpanAttributes(attributes: Record { expect(capturedSpanConfig!.op).toBe(GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE); expect(capturedSpanConfig!.attributes[GEN_AI_OPERATION_NAME]).toBe('embeddings'); expect(capturedSpanConfig!.attributes[GEN_AI_REQUEST_MODEL]).toBe('text-embedding-3-small'); - expect(capturedSpanConfig!.attributes[GEN_AI_SYSTEM]).toBe('openai'); + expect(capturedSpanConfig!.attributes[GEN_AI_PROVIDER_NAME]).toBe('openai'); expect(capturedSpanConfig!.attributes[GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE]).toBe(1536); expect(capturedSpanConfig!.attributes[GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE]).toBe('float'); expect(original).toHaveBeenCalledWith('Hello world'); @@ -95,7 +95,7 @@ describe('instrumentEmbeddingMethod', () => { const wrapped = instrumentEmbeddingMethod(original); await wrapped.call({ constructor: { name: 'GoogleGenerativeAIEmbeddings' }, model: 'test' }, 'test'); - expect(capturedSpanConfig!.attributes[GEN_AI_SYSTEM]).toBe('google_genai'); + expect(capturedSpanConfig!.attributes[GEN_AI_PROVIDER_NAME]).toBe('google_genai'); }); it('handles missing instance properties gracefully', async () => { @@ -106,7 +106,7 @@ describe('instrumentEmbeddingMethod', () => { expect(capturedSpanConfig!.name).toBe('embeddings unknown'); expect(capturedSpanConfig!.attributes[GEN_AI_REQUEST_MODEL]).toBe('unknown'); - expect(capturedSpanConfig!.attributes[GEN_AI_SYSTEM]).toBe('langchain'); + expect(capturedSpanConfig!.attributes[GEN_AI_PROVIDER_NAME]).toBe('langchain'); expect(capturedSpanConfig!.attributes[GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE]).toBeUndefined(); }); }); diff --git a/packages/server-utils/src/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.ts b/packages/server-utils/src/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.ts index 94cab0159c18..e5e24aea875f 100644 --- a/packages/server-utils/src/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.ts +++ b/packages/server-utils/src/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.ts @@ -2,13 +2,13 @@ import type { Span } from '@sentry/core'; import { debug } from '@sentry/core'; import { GEN_AI_OPERATION_NAME, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_STOP_SEQUENCES as ATTR_GEN_AI_REQUEST_STOP_SEQUENCES, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_REQUEST_TOP_P, GEN_AI_RESPONSE_FINISH_REASONS, - GEN_AI_SYSTEM, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, } from '@sentry/conventions/attributes'; @@ -82,8 +82,7 @@ export class BedrockRuntimeServiceExtension implements ServiceExtension { private _requestPreSpanHookConverse(request: NormalizedRequest, isStream: boolean): RequestMetadata { let spanName = GEN_AI_OPERATION_NAME_VALUE_CHAT; const spanAttributes: Record = { - // oxlint-disable-next-line typescript/no-deprecated - [GEN_AI_SYSTEM]: GEN_AI_SYSTEM_VALUE_AWS_BEDROCK, + [GEN_AI_PROVIDER_NAME]: GEN_AI_SYSTEM_VALUE_AWS_BEDROCK, [GEN_AI_OPERATION_NAME]: GEN_AI_OPERATION_NAME_VALUE_CHAT, }; @@ -121,8 +120,7 @@ export class BedrockRuntimeServiceExtension implements ServiceExtension { private _requestPreSpanHookInvokeModel(request: NormalizedRequest, isStream: boolean): RequestMetadata { const spanAttributes: Record = { - // oxlint-disable-next-line typescript/no-deprecated - [GEN_AI_SYSTEM]: GEN_AI_SYSTEM_VALUE_AWS_BEDROCK, + [GEN_AI_PROVIDER_NAME]: GEN_AI_SYSTEM_VALUE_AWS_BEDROCK, }; const modelId = request.commandInput?.modelId; diff --git a/packages/server-utils/src/vercel-ai/vercel-ai-dc-subscriber.ts b/packages/server-utils/src/vercel-ai/vercel-ai-dc-subscriber.ts index 79ded795c817..bf55e814683f 100644 --- a/packages/server-utils/src/vercel-ai/vercel-ai-dc-subscriber.ts +++ b/packages/server-utils/src/vercel-ai/vercel-ai-dc-subscriber.ts @@ -1,8 +1,4 @@ /* eslint-disable max-lines */ -// `@sentry/conventions` marks several gen_ai attributes (e.g. `GEN_AI_SYSTEM`, `GEN_AI_TOOL_*`, -// `GEN_AI_REQUEST_AVAILABLE_TOOLS`) as deprecated in favour of newer semconv names. We intentionally -// keep emitting the current names so these spans match the OTel-based (v6) integration and what the -// Sentry product consumes today; migrating to the new names is a separate, coordinated change. /* eslint-disable typescript-eslint/no-deprecated */ import { GEN_AI_EMBEDDINGS_INPUT, @@ -10,13 +6,13 @@ import { GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, GEN_AI_OUTPUT_MESSAGES, + GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_AVAILABLE_TOOLS, GEN_AI_REQUEST_MODEL, GEN_AI_RESPONSE_FINISH_REASONS, GEN_AI_RESPONSE_ID, GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_STREAMING, - GEN_AI_SYSTEM, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_TOOL_INPUT, GEN_AI_TOOL_NAME, @@ -383,7 +379,7 @@ export function createSpanFromMessage( const baseAttributes: Record = { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, - ...(provider ? { [GEN_AI_SYSTEM]: provider, [VERCEL_AI_MODEL_PROVIDER_ATTRIBUTE]: provider } : {}), + ...(provider ? { [GEN_AI_PROVIDER_NAME]: provider, [VERCEL_AI_MODEL_PROVIDER_ATTRIBUTE]: provider } : {}), ...(modelId ? { [GEN_AI_REQUEST_MODEL]: modelId } : {}), ...(maxRetries !== undefined ? { [VERCEL_AI_SETTINGS_MAX_RETRIES_ATTRIBUTE]: maxRetries } : {}), };