Skip to content

Commit c149d10

Browse files
committed
Use separate instrument files for disabled recording
1 parent 58a108e commit c149d10

5 files changed

Lines changed: 38 additions & 8 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
4+
Sentry.init({
5+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
transport: loggingTransport,
9+
dataCollection: { genAI: { inputs: false, outputs: false } },
10+
// `instrumentTypeSafeClient` is the manual path for runtimes without the orchestrion hook.
11+
// Drop the automatic integration so the scenario exercises it alone.
12+
integrations: integrations => integrations.filter(integration => integration.name !== 'TypeSafe'),
13+
});

‎dev-packages/node-integration-tests/suites/tracing/typesafe/instrument-manual.mjs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Sentry.init({
66
release: '1.0',
77
tracesSampleRate: 1.0,
88
transport: loggingTransport,
9-
// `NO_RECORDING` turns off recording of inputs and outputs for the privacy test.
10-
...(process.env.NO_RECORDING ? { dataCollection: { genAI: { inputs: false, outputs: false } } } : {}),
119
// `instrumentTypeSafeClient` is the manual path for runtimes without the orchestrion hook.
1210
// Drop the automatic integration so the scenario exercises it alone.
1311
integrations: integrations => integrations.filter(integration => integration.name !== 'TypeSafe'),
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
4+
Sentry.init({
5+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
transport: loggingTransport,
9+
dataCollection: { genAI: { inputs: false, outputs: false } },
10+
});

‎dev-packages/node-integration-tests/suites/tracing/typesafe/instrument.mjs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ Sentry.init({
66
release: '1.0',
77
tracesSampleRate: 1.0,
88
transport: loggingTransport,
9-
// `NO_RECORDING` turns off recording of inputs and outputs for the privacy test.
10-
...(process.env.NO_RECORDING ? { dataCollection: { genAI: { inputs: false, outputs: false } } } : {}),
119
});

‎dev-packages/node-integration-tests/suites/tracing/typesafe/test.ts‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ describe('TypeSafe integration', () => {
2020
});
2121

2222
describe.each([
23-
['automatic', 'instrument.mjs'],
24-
['manual', 'instrument-manual.mjs'],
25-
])('%s instrumentation', (_, instrumentFile) => {
23+
['automatic', 'instrument.mjs', 'instrument-no-recording.mjs'],
24+
['manual', 'instrument-manual.mjs', 'instrument-manual-no-recording.mjs'],
25+
])('%s instrumentation', (_, instrumentFile, noRecordingInstrumentFile) => {
2626
createEsmAndCjsTests(
2727
__dirname,
2828
'scenario.mjs',
@@ -112,10 +112,21 @@ describe('TypeSafe integration', () => {
112112
.start()
113113
.completed();
114114
});
115+
},
116+
{
117+
additionalDependencies: {
118+
'@typesafe-ai/sdk': '^0.6.0',
119+
},
120+
},
121+
);
115122

123+
createEsmAndCjsTests(
124+
__dirname,
125+
'scenario.mjs',
126+
noRecordingInstrumentFile,
127+
(createRunner, test) => {
116128
test('does not record inputs or outputs when recording is off', async () => {
117129
await createRunner()
118-
.withEnv({ NO_RECORDING: 'true' })
119130
.unordered()
120131
.expect({
121132
span: container => {

0 commit comments

Comments
 (0)