Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,7 @@
"scenario": null
},
"metric_keys": [
"completion_accepted_prediction_tokens",
"completion_audio_tokens",
"completion_reasoning_tokens",
"completion_rejected_prediction_tokens",
"completion_tokens",
"prompt_audio_tokens",
"prompt_cached_tokens",
"prompt_tokens",
"time_to_first_token",
"tokens"
"time_to_first_token"
],
"name": "Chat Completion",
"root_span_id": "<span:1>",
Expand Down Expand Up @@ -646,7 +637,7 @@
"time_to_first_token",
"tokens"
],
"name": "openai.responses.create",
"name": "openai.responses.parse",
"root_span_id": "<span:1>",
"span_id": "<span:29>",
"span_parents": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,7 @@
"scenario": null
},
"metric_keys": [
"completion_accepted_prediction_tokens",
"completion_audio_tokens",
"completion_reasoning_tokens",
"completion_rejected_prediction_tokens",
"completion_tokens",
"prompt_audio_tokens",
"prompt_cached_tokens",
"prompt_tokens",
"time_to_first_token",
"tokens"
"time_to_first_token"
],
"name": "Chat Completion",
"root_span_id": "<span:1>",
Expand Down Expand Up @@ -646,7 +637,7 @@
"time_to_first_token",
"tokens"
],
"name": "openai.responses.create",
"name": "openai.responses.parse",
"root_span_id": "<span:1>",
"span_id": "<span:29>",
"span_parents": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,7 @@
"scenario": null
},
"metric_keys": [
"completion_accepted_prediction_tokens",
"completion_audio_tokens",
"completion_reasoning_tokens",
"completion_rejected_prediction_tokens",
"completion_tokens",
"prompt_audio_tokens",
"prompt_cached_tokens",
"prompt_tokens",
"time_to_first_token",
"tokens"
"time_to_first_token"
],
"name": "Chat Completion",
"root_span_id": "<span:1>",
Expand Down Expand Up @@ -646,7 +637,7 @@
"time_to_first_token",
"tokens"
],
"name": "openai.responses.create",
"name": "openai.responses.parse",
"root_span_id": "<span:1>",
"span_id": "<span:29>",
"span_parents": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export async function runOpenAIAutoInstrumentationNodeHook(
projectNameBase: "e2e-openai-auto-instrumentation-hook",
rootName: "openai-auto-hook-root",
scenarioName: "openai-auto-instrumentation-node-hook",
useChatParseHelper: false,
useResponsesParseHelper: false,
useSyncStreamHelper: false,
});
}

Expand Down
18 changes: 9 additions & 9 deletions js/src/auto-instrumentations/configs/openai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("OpenAI Instrumentation Configs", () => {
functionQuery: expect.objectContaining({
className: "Completions",
methodName: "create",
kind: "Async",
kind: "Sync",
}),
}),
expect.objectContaining({
Expand All @@ -39,7 +39,7 @@ describe("OpenAI Instrumentation Configs", () => {
functionQuery: expect.objectContaining({
className: "Completions",
methodName: "create",
kind: "Async",
kind: "Sync",
}),
}),
expect.objectContaining({
Expand All @@ -51,7 +51,7 @@ describe("OpenAI Instrumentation Configs", () => {
functionQuery: expect.objectContaining({
className: "Completions",
methodName: "create",
kind: "Async",
kind: "Sync",
}),
}),
]),
Expand All @@ -67,7 +67,7 @@ describe("OpenAI Instrumentation Configs", () => {
expect(config?.module.name).toBe("openai");
expect((config?.functionQuery as any).className).toBe("Embeddings");
expect((config?.functionQuery as any).methodName).toBe("create");
expect((config?.functionQuery as any).kind).toBe("Async");
expect((config?.functionQuery as any).kind).toBe("Sync");
});

it("should have moderations.create config", () => {
Expand All @@ -79,7 +79,7 @@ describe("OpenAI Instrumentation Configs", () => {
expect(config?.module.name).toBe("openai");
expect((config?.functionQuery as any).className).toBe("Moderations");
expect((config?.functionQuery as any).methodName).toBe("create");
expect((config?.functionQuery as any).kind).toBe("Async");
expect((config?.functionQuery as any).kind).toBe("Sync");
});

it("should have beta.chat.completions.parse config", () => {
Expand All @@ -97,7 +97,7 @@ describe("OpenAI Instrumentation Configs", () => {
functionQuery: expect.objectContaining({
className: "Completions",
methodName: "parse",
kind: "Async",
kind: "Sync",
}),
}),
expect.objectContaining({
Expand All @@ -109,7 +109,7 @@ describe("OpenAI Instrumentation Configs", () => {
functionQuery: expect.objectContaining({
className: "Completions",
methodName: "parse",
kind: "Async",
kind: "Sync",
}),
}),
]),
Expand Down Expand Up @@ -189,7 +189,7 @@ describe("OpenAI Instrumentation Configs", () => {
expect(config?.module.filePath).toBe("resources/responses/responses.mjs");
expect((config?.functionQuery as any).className).toBe("Responses");
expect((config?.functionQuery as any).methodName).toBe("create");
expect((config?.functionQuery as any).kind).toBe("Async");
expect((config?.functionQuery as any).kind).toBe("Sync");
});

it("should have responses.stream config with Sync kind and version >=4.87.0", () => {
Expand Down Expand Up @@ -217,6 +217,6 @@ describe("OpenAI Instrumentation Configs", () => {
expect(config?.module.filePath).toBe("resources/responses/responses.mjs");
expect((config?.functionQuery as any).className).toBe("Responses");
expect((config?.functionQuery as any).methodName).toBe("parse");
expect((config?.functionQuery as any).kind).toBe("Async");
expect((config?.functionQuery as any).kind).toBe("Sync");
});
});
18 changes: 9 additions & 9 deletions js/src/auto-instrumentations/configs/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Completions",
methodName: "create",
kind: "Async",
kind: "Sync",
},
},

Expand All @@ -38,7 +38,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Completions",
methodName: "create",
kind: "Async",
kind: "Sync",
},
},

Expand All @@ -52,7 +52,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Completions",
methodName: "create",
kind: "Async",
kind: "Sync",
},
},

Expand All @@ -67,7 +67,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Embeddings",
methodName: "create",
kind: "Async",
kind: "Sync",
},
},

Expand All @@ -82,7 +82,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Completions",
methodName: "parse",
kind: "Async",
kind: "Sync",
},
},

Expand All @@ -96,7 +96,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Completions",
methodName: "parse",
kind: "Async",
kind: "Sync",
},
},

Expand All @@ -111,7 +111,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Moderations",
methodName: "create",
kind: "Async",
kind: "Sync",
},
},

Expand Down Expand Up @@ -155,7 +155,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Responses",
methodName: "create",
kind: "Async",
kind: "Sync",
},
},

Expand Down Expand Up @@ -183,7 +183,7 @@ export const openaiConfigs: InstrumentationConfig[] = [
functionQuery: {
className: "Responses",
methodName: "parse",
kind: "Async",
kind: "Sync",
},
},
];
Loading
Loading