Skip to content

Commit feb9edd

Browse files
committed
debug
1 parent 621407d commit feb9edd

File tree

3 files changed

+82
-40
lines changed

3 files changed

+82
-40
lines changed

dev-packages/node-integration-tests/suites/tracing/langchain/v1/instrument-with-pii.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Sentry.init({
77
tracesSampleRate: 1.0,
88
sendDefaultPii: true,
99
transport: loggingTransport,
10+
debug: true,
1011
beforeSendTransaction: event => {
1112
// Filter out mock express server transactions
1213
if (event.transaction.includes('/v1/messages') || event.transaction.includes('/v1/chat/completions')) {

dev-packages/node-integration-tests/suites/tracing/langchain/v1/instrument.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Sentry.init({
77
tracesSampleRate: 1.0,
88
sendDefaultPii: false,
99
transport: loggingTransport,
10+
debug: true,
1011
beforeSendTransaction: event => {
1112
// Filter out mock express server transactions
1213
if (event.transaction.includes('/v1/messages') || event.transaction.includes('/v1/chat/completions')) {

dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts

Lines changed: 80 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { afterAll, describe, expect } from 'vitest';
22
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../../utils/runner';
33

4+
process.env.DEBUG = 'true';
5+
46
describe('LangChain integration (v1)', () => {
57
afterAll(() => {
68
cleanupChildProcesses();
@@ -146,13 +148,19 @@ describe('LangChain integration (v1)', () => {
146148
'scenario.mjs',
147149
'instrument.mjs',
148150
(createRunner, test) => {
149-
test('creates langchain related spans with sendDefaultPii: false', async () => {
150-
await createRunner()
151-
.ignore('event')
152-
.expect({ transaction: EXPECTED_TRANSACTION_DEFAULT_PII_FALSE })
153-
.start()
154-
.completed();
155-
});
151+
test('creates langchain related spans with sendDefaultPii: false', { timeout: 30_000 }, async () => {
152+
const runner = createRunner().ignore('event').expect({ transaction: EXPECTED_TRANSACTION_DEFAULT_PII_FALSE });
153+
154+
const runnerInstance = runner.start();
155+
156+
try {
157+
await runnerInstance.completed();
158+
} catch (e) {
159+
// eslint-disable-next-line no-console
160+
console.error('Runner logs:\n', runnerInstance.getLogs().join('\n'));
161+
throw e;
162+
}
163+
});
156164
},
157165
{
158166
additionalDependencies: {
@@ -168,13 +176,19 @@ describe('LangChain integration (v1)', () => {
168176
'scenario.mjs',
169177
'instrument-with-pii.mjs',
170178
(createRunner, test) => {
171-
test('creates langchain related spans with sendDefaultPii: true', async () => {
172-
await createRunner()
173-
.ignore('event')
174-
.expect({ transaction: EXPECTED_TRANSACTION_DEFAULT_PII_TRUE })
175-
.start()
176-
.completed();
177-
});
179+
test('creates langchain related spans with sendDefaultPii: true', { timeout: 30_000 }, async () => {
180+
const runner = createRunner().ignore('event').expect({ transaction: EXPECTED_TRANSACTION_DEFAULT_PII_TRUE });
181+
182+
const runnerInstance = runner.start();
183+
184+
try {
185+
await runnerInstance.completed();
186+
} catch (e) {
187+
// eslint-disable-next-line no-console
188+
console.error('Runner logs:\n', runnerInstance.getLogs().join('\n'));
189+
throw e;
190+
}
191+
});
178192
},
179193
{
180194
additionalDependencies: {
@@ -218,13 +232,19 @@ describe('LangChain integration (v1)', () => {
218232
'scenario-tools.mjs',
219233
'instrument.mjs',
220234
(createRunner, test) => {
221-
test('creates langchain spans with tool calls', async () => {
222-
await createRunner()
223-
.ignore('event')
224-
.expect({ transaction: EXPECTED_TRANSACTION_TOOL_CALLS })
225-
.start()
226-
.completed();
227-
});
235+
test('creates langchain spans with tool calls', { timeout: 30_000 }, async () => {
236+
const runner = createRunner().ignore('event').expect({ transaction: EXPECTED_TRANSACTION_TOOL_CALLS });
237+
238+
const runnerInstance = runner.start();
239+
240+
try {
241+
await runnerInstance.completed();
242+
} catch (e) {
243+
// eslint-disable-next-line no-console
244+
console.error('Runner logs:\n', runnerInstance.getLogs().join('\n'));
245+
throw e;
246+
}
247+
});
228248
},
229249
{
230250
additionalDependencies: {
@@ -276,13 +296,19 @@ describe('LangChain integration (v1)', () => {
276296
'scenario-message-truncation.mjs',
277297
'instrument-with-pii.mjs',
278298
(createRunner, test) => {
279-
test('truncates messages when they exceed byte limit', async () => {
280-
await createRunner()
281-
.ignore('event')
282-
.expect({ transaction: EXPECTED_TRANSACTION_MESSAGE_TRUNCATION })
283-
.start()
284-
.completed();
285-
});
299+
test('truncates messages when they exceed byte limit', { timeout: 30_000 }, async () => {
300+
const runner = createRunner().ignore('event').expect({ transaction: EXPECTED_TRANSACTION_MESSAGE_TRUNCATION });
301+
302+
const runnerInstance = runner.start();
303+
304+
try {
305+
await runnerInstance.completed();
306+
} catch (e) {
307+
// eslint-disable-next-line no-console
308+
console.error('Runner logs:\n', runnerInstance.getLogs().join('\n'));
309+
throw e;
310+
}
311+
});
286312
},
287313
{
288314
additionalDependencies: {
@@ -298,8 +324,8 @@ describe('LangChain integration (v1)', () => {
298324
'scenario-openai-before-langchain.mjs',
299325
'instrument.mjs',
300326
(createRunner, test) => {
301-
test('demonstrates timing issue with duplicate spans (ESM only)', async () => {
302-
await createRunner()
327+
test('demonstrates timing issue with duplicate spans (ESM only)', { timeout: 30_000 }, async () => {
328+
const runner = createRunner()
303329
.ignore('event')
304330
.expect({
305331
transaction: event => {
@@ -344,9 +370,17 @@ describe('LangChain integration (v1)', () => {
344370
// We should only have ONE Anthropic span (the first one), not two
345371
expect(anthropicSpans).toHaveLength(1);
346372
},
347-
})
348-
.start()
349-
.completed();
373+
});
374+
375+
const runnerInstance = runner.start();
376+
377+
try {
378+
await runnerInstance.completed();
379+
} catch (e) {
380+
// eslint-disable-next-line no-console
381+
console.error('Runner logs:\n', runnerInstance.getLogs().join('\n'));
382+
throw e;
383+
}
350384
});
351385
},
352386
{
@@ -427,13 +461,19 @@ describe('LangChain integration (v1)', () => {
427461
'scenario-init-chat-model.mjs',
428462
'instrument.mjs',
429463
(createRunner, test) => {
430-
test('creates langchain spans using initChatModel with OpenAI', async () => {
431-
await createRunner()
432-
.ignore('event')
433-
.expect({ transaction: EXPECTED_TRANSACTION_INIT_CHAT_MODEL })
434-
.start()
435-
.completed();
436-
});
464+
test('creates langchain spans using initChatModel with OpenAI', { timeout: 30_000 }, async () => {
465+
const runner = createRunner().ignore('event').expect({ transaction: EXPECTED_TRANSACTION_INIT_CHAT_MODEL });
466+
467+
const runnerInstance = runner.start();
468+
469+
try {
470+
await runnerInstance.completed();
471+
} catch (e) {
472+
// eslint-disable-next-line no-console
473+
console.error('Runner logs:\n', runnerInstance.getLogs().join('\n'));
474+
throw e;
475+
}
476+
});
437477
},
438478
{
439479
additionalDependencies: {

0 commit comments

Comments
 (0)