Skip to content

Commit 046bc70

Browse files
committed
ref(core): Add more specific event mechanisms to openAiIntegration
1 parent e2579bb commit 046bc70

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ function instrumentMethod<T extends unknown[], R>(
256256
captureException(error, {
257257
mechanism: {
258258
handled: false,
259+
type: 'openai.stream',
260+
data: {
261+
function: methodPath,
262+
},
259263
},
260264
});
261265
span.end();
@@ -281,7 +285,15 @@ function instrumentMethod<T extends unknown[], R>(
281285
addResponseAttributes(span, result, finalOptions.recordOutputs);
282286
return result;
283287
} catch (error) {
284-
captureException(error);
288+
captureException(error, {
289+
mechanism: {
290+
handled: false,
291+
type: 'openai',
292+
data: {
293+
function: methodPath,
294+
},
295+
},
296+
});
285297
throw error;
286298
}
287299
},

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ function processResponsesApiEvent(
152152
captureException(streamEvent, {
153153
mechanism: {
154154
handled: false,
155+
type: 'openai.stream-response',
155156
},
156157
});
157158
return;

0 commit comments

Comments
 (0)