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 @@ -57,7 +57,6 @@ describe('Anthropic integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-with-response.mjs', 'instrument.mjs', (createRunner, test) => {
test('preserves .withResponse() and .asResponse() for non-streaming and streaming', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -304,7 +303,6 @@ describe('Anthropic integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-stream.mjs', 'instrument.mjs', (createRunner, test) => {
test('streams produce spans with token usage and metadata (PII false)', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: EXPECTED_STREAM_SPANS_PII_FALSE })
.expect({
span: container => {
Expand Down Expand Up @@ -358,7 +356,6 @@ describe('Anthropic integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-stream.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('streams record response text when PII true', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: EXPECTED_STREAM_SPANS_PII_TRUE })
.expect({
span: container => {
Expand Down Expand Up @@ -409,7 +406,6 @@ describe('Anthropic integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-stream-nested-create.mjs', 'instrument.mjs', (createRunner, test) => {
test('traces a create() invoked from a stream event handler (dedup does not over-suppress)', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -440,7 +436,6 @@ describe('Anthropic integration', () => {
const EXPECTED_TOOL_CALLS_JSON =
'[{"type":"tool_use","id":"tool_weather_1","name":"weather","input":{"city":"Paris"}}]';
await createRunner()
.ignore('event')
.expect({
transaction: {},
})
Expand Down Expand Up @@ -470,7 +465,6 @@ describe('Anthropic integration', () => {
const EXPECTED_TOOL_CALLS_JSON =
'[{"type":"tool_use","id":"tool_weather_2","name":"weather","input":{"city":"Paris"}}]';
await createRunner()
.ignore('event')
.expect({
transaction: {},
})
Expand Down Expand Up @@ -511,6 +505,8 @@ describe('Anthropic integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-stream-errors.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('handles streaming errors correctly', async () => {
await createRunner()
// Anthropic surfaces stream errors as events on a resolved stream rather than by rejecting,
// so the instrumentation still reports them; the caller never sees them as a thrown error.
.ignore('event')
.expect({ transaction: EXPECTED_STREAM_ERROR_SPANS })
.expect({
Expand Down Expand Up @@ -564,7 +560,6 @@ describe('Anthropic integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-errors.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('handles tool errors and model retrieval errors correctly', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: EXPECTED_ERROR_SPANS })
.expect({
span: container => {
Expand Down Expand Up @@ -599,7 +594,6 @@ describe('Anthropic integration', () => {
(createRunner, test) => {
test('truncates messages when they exceed byte limit - keeps only last message and crops it', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -666,7 +660,6 @@ describe('Anthropic integration', () => {
},
]);
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -702,7 +695,6 @@ describe('Anthropic integration', () => {
test('extracts system instructions from messages', async () => {
const expectedInstructions = JSON.stringify([{ type: 'text', content: 'You are a helpful assistant' }]);
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -743,7 +735,6 @@ describe('Anthropic integration', () => {
]);
const expectedLongString = JSON.stringify([longStringInput]);
await createRunner()
.ignore('event')
.expect({ transaction: EXPECTED_TRANSACTION_NO_TRUNCATION })
.expect({
span: container => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
test('creates google genai related spans with genAI recording disabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -87,7 +86,6 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('creates google genai related spans with genAI recording enabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -138,7 +136,6 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument-with-options.mjs', (createRunner, test) => {
test('creates google genai related spans with custom options', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -175,7 +172,6 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-tools.mjs', 'instrument-with-options.mjs', (createRunner, test) => {
test('creates google genai related spans with tool calls', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -236,6 +232,7 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-streaming.mjs', 'instrument.mjs', (createRunner, test) => {
test('creates google genai streaming spans with genAI recording disabled', async () => {
await createRunner()
// Blocked content is reported from within the stream, not thrown to the caller.
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
Expand Down Expand Up @@ -292,6 +289,7 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-streaming.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('creates google genai streaming spans with genAI recording enabled', async () => {
await createRunner()
// Blocked content is reported from within the stream, not thrown to the caller.
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
Expand Down Expand Up @@ -351,7 +349,6 @@ describe('Google GenAI integration', () => {
(createRunner, test) => {
test('truncates messages when they exceed byte limit - keeps only last message and crops it', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -395,7 +392,6 @@ describe('Google GenAI integration', () => {
(createRunner, test) => {
test('extracts system instructions from messages', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand All @@ -419,7 +415,6 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-embeddings.mjs', 'instrument.mjs', (createRunner, test) => {
test('creates google genai embeddings spans with genAI recording disabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -458,7 +453,6 @@ describe('Google GenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-embeddings.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('creates google genai embeddings spans with genAI recording enabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -511,7 +505,6 @@ describe('Google GenAI integration', () => {
(createRunner, test) => {
test('does not truncate input messages when enableTruncation is false', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ describe('OpenAI Tool Calls integration', () => {
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
test('creates openai tool calls related spans with genAI recording disabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -326,7 +325,6 @@ describe('OpenAI Tool Calls integration', () => {
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('creates openai tool calls related spans with genAI recording enabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-chat.mjs', 'instrument.mjs', (createRunner, test) => {
test('creates openai related spans with genAI recording disabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -334,7 +333,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-chat.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('creates openai related spans with genAI recording enabled', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -682,7 +680,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-chat.mjs', 'instrument-with-options.mjs', (createRunner, test) => {
test('creates openai related spans with custom options', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -733,7 +730,6 @@ describe('OpenAI integration', () => {
(createRunner, test) => {
test('does not truncate input messages when enableTruncation is false', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -782,7 +778,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-embeddings.mjs', 'instrument.mjs', (createRunner, test) => {
test('creates openai related spans with genAI recording disabled', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -915,7 +910,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-embeddings.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('creates openai related spans with genAI recording enabled', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -1148,7 +1142,6 @@ describe('OpenAI integration', () => {
(createRunner, test) => {
test('truncates messages when they exceed byte limit - keeps only last message and crops it', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -1244,7 +1237,6 @@ describe('OpenAI integration', () => {
(createRunner, test) => {
test('truncates string inputs when they exceed byte limit', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -1285,7 +1277,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-conversation.mjs', 'instrument.mjs', (createRunner, test) => {
test('captures conversation ID from Conversations API and previous_response_id', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'conversation-test',
Expand Down Expand Up @@ -1405,7 +1396,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-manual-conversation-id.mjs', 'instrument.mjs', (createRunner, test) => {
test('attaches manual conversation ID set via setConversationId() to all chat spans', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'chat-with-manual-conversation-id',
Expand Down Expand Up @@ -1438,7 +1428,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-separate-scope-1.mjs', 'instrument.mjs', (createRunner, test) => {
test('isolates conversation IDs across separate scopes - conversation 1', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'GET /chat/conversation-1',
Expand Down Expand Up @@ -1470,7 +1459,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-separate-scope-2.mjs', 'instrument.mjs', (createRunner, test) => {
test('isolates conversation IDs across separate scopes - conversation 2', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'GET /chat/conversation-2',
Expand Down Expand Up @@ -1506,7 +1494,6 @@ describe('OpenAI integration', () => {
(createRunner, test) => {
test('extracts system instructions from messages', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand All @@ -1533,7 +1520,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-with-response.mjs', 'instrument.mjs', (createRunner, test) => {
test('preserves .withResponse() method and works correctly', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -1564,7 +1550,6 @@ describe('OpenAI integration', () => {
createEsmAndCjsTests(__dirname, 'scenario-vision.mjs', 'instrument-with-truncation.mjs', (createRunner, test) => {
test('redacts inline base64 image data in vision requests', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand All @@ -1590,7 +1575,6 @@ describe('OpenAI integration', () => {

test('preserves regular URLs in image_url (does not redact https links)', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('OpenAI integration (V6)', () => {
(createRunner, test) => {
test('creates openai related spans with genAI recording disabled (v6)', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -346,7 +345,6 @@ describe('OpenAI integration (V6)', () => {
(createRunner, test) => {
test('creates openai related spans with genAI recording enabled (v6)', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -704,7 +702,6 @@ describe('OpenAI integration (V6)', () => {
(createRunner, test) => {
test('creates openai related spans with custom options (v6)', async () => {
await createRunner()
.ignore('event')
.expect({ transaction: { transaction: 'main' } })
.expect({
span: container => {
Expand Down Expand Up @@ -767,7 +764,6 @@ describe('OpenAI integration (V6)', () => {
(createRunner, test) => {
test('creates openai related spans with genAI recording disabled (v6)', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down Expand Up @@ -910,7 +906,6 @@ describe('OpenAI integration (V6)', () => {
(createRunner, test) => {
test('creates openai related spans with genAI recording enabled (v6)', async () => {
await createRunner()
.ignore('event')
.expect({
transaction: {
transaction: 'main',
Expand Down
Loading