Skip to content

Commit 96e21b2

Browse files
committed
update type to trace origin, set origin
1 parent 53ee33c commit 96e21b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/src/utils/openai/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getCurrentScope } from '../../currentScopes';
22
import { captureException } from '../../exports';
3+
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes';
34
import { SPAN_STATUS_ERROR } from '../../tracing';
45
import { startSpan, startSpanManual } from '../../tracing/trace';
56
import type { Span, SpanAttributeValue } from '../../types-hoist/span';
@@ -50,6 +51,7 @@ function extractRequestAttributes(args: unknown[], methodPath: string): Record<s
5051
const attributes: Record<string, unknown> = {
5152
[GEN_AI_SYSTEM_ATTRIBUTE]: 'openai',
5253
[GEN_AI_OPERATION_NAME_ATTRIBUTE]: getOperationName(methodPath),
54+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai',
5355
};
5456

5557
// Chat completion API accepts web_search_options and tools as parameters
@@ -257,7 +259,7 @@ function instrumentMethod<T extends unknown[], R>(
257259
captureException(error, {
258260
mechanism: {
259261
handled: false,
260-
type: 'openai.stream',
262+
type: 'auto.ai.openai.stream',
261263
data: {
262264
function: methodPath,
263265
},
@@ -289,7 +291,7 @@ function instrumentMethod<T extends unknown[], R>(
289291
captureException(error, {
290292
mechanism: {
291293
handled: false,
292-
type: 'openai',
294+
type: 'auto.ai.openai',
293295
data: {
294296
function: methodPath,
295297
},

0 commit comments

Comments
 (0)