|
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';
|
@@ -49,6 +50,7 @@ function extractRequestAttributes(args: unknown[], methodPath: string): Record<s
|
49 | 50 | const attributes: Record<string, unknown> = {
|
50 | 51 | [GEN_AI_SYSTEM_ATTRIBUTE]: 'openai',
|
51 | 52 | [GEN_AI_OPERATION_NAME_ATTRIBUTE]: getOperationName(methodPath),
|
| 53 | + [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai', |
52 | 54 | };
|
53 | 55 |
|
54 | 56 | // Chat completion API accepts web_search_options and tools as parameters
|
@@ -256,7 +258,7 @@ function instrumentMethod<T extends unknown[], R>(
|
256 | 258 | captureException(error, {
|
257 | 259 | mechanism: {
|
258 | 260 | handled: false,
|
259 |
| - type: 'openai.stream', |
| 261 | + type: 'auto.ai.openai.stream', |
260 | 262 | data: {
|
261 | 263 | function: methodPath,
|
262 | 264 | },
|
@@ -288,7 +290,7 @@ function instrumentMethod<T extends unknown[], R>(
|
288 | 290 | captureException(error, {
|
289 | 291 | mechanism: {
|
290 | 292 | handled: false,
|
291 |
| - type: 'openai', |
| 293 | + type: 'auto.ai.openai', |
292 | 294 | data: {
|
293 | 295 | function: methodPath,
|
294 | 296 | },
|
|
0 commit comments