Skip to content

Commit c3e94e7

Browse files
committed
update type to trace origin, set origin
1 parent 046bc70 commit c3e94e7

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';
@@ -49,6 +50,7 @@ function extractRequestAttributes(args: unknown[], methodPath: string): Record<s
4950
const attributes: Record<string, unknown> = {
5051
[GEN_AI_SYSTEM_ATTRIBUTE]: 'openai',
5152
[GEN_AI_OPERATION_NAME_ATTRIBUTE]: getOperationName(methodPath),
53+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.openai',
5254
};
5355

5456
// Chat completion API accepts web_search_options and tools as parameters
@@ -256,7 +258,7 @@ function instrumentMethod<T extends unknown[], R>(
256258
captureException(error, {
257259
mechanism: {
258260
handled: false,
259-
type: 'openai.stream',
261+
type: 'auto.ai.openai.stream',
260262
data: {
261263
function: methodPath,
262264
},
@@ -288,7 +290,7 @@ function instrumentMethod<T extends unknown[], R>(
288290
captureException(error, {
289291
mechanism: {
290292
handled: false,
291-
type: 'openai',
293+
type: 'auto.ai.openai',
292294
data: {
293295
function: methodPath,
294296
},

0 commit comments

Comments
 (0)