|
1 | 1 | import { getCurrentScope } from '../../currentScopes'; |
2 | 2 | import { captureException } from '../../exports'; |
| 3 | +import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes'; |
3 | 4 | import { SPAN_STATUS_ERROR } from '../../tracing'; |
4 | 5 | import { startSpan, startSpanManual } from '../../tracing/trace'; |
5 | 6 | import type { Span, SpanAttributeValue } from '../../types-hoist/span'; |
@@ -50,6 +51,7 @@ function extractRequestAttributes(args: unknown[], methodPath: string): Record<s |
50 | 51 | const attributes: Record<string, unknown> = { |
51 | 52 | [GEN_AI_SYSTEM_ATTRIBUTE]: 'openai', |
52 | 53 | [GEN_AI_OPERATION_NAME_ATTRIBUTE]: getOperationName(methodPath), |
| 54 | + [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai', |
53 | 55 | }; |
54 | 56 |
|
55 | 57 | // Chat completion API accepts web_search_options and tools as parameters |
@@ -257,7 +259,7 @@ function instrumentMethod<T extends unknown[], R>( |
257 | 259 | captureException(error, { |
258 | 260 | mechanism: { |
259 | 261 | handled: false, |
260 | | - type: 'openai.stream', |
| 262 | + type: 'auto.ai.openai.stream', |
261 | 263 | data: { |
262 | 264 | function: methodPath, |
263 | 265 | }, |
@@ -289,7 +291,7 @@ function instrumentMethod<T extends unknown[], R>( |
289 | 291 | captureException(error, { |
290 | 292 | mechanism: { |
291 | 293 | handled: false, |
292 | | - type: 'openai', |
| 294 | + type: 'auto.ai.openai', |
293 | 295 | data: { |
294 | 296 | function: methodPath, |
295 | 297 | }, |
|
0 commit comments