-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathscenario.ts
More file actions
28 lines (24 loc) · 1.01 KB
/
scenario.ts
File metadata and controls
28 lines (24 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import * as Sentry from '@sentry/node';
import { loggingTransport } from '@sentry-internal/node-integration-tests';
const MAX_FLAGS_PER_SPAN = 10;
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
sampleRate: 1.0,
// // disable attaching headers to /test/* endpoints
// tracePropagationTargets: [/^(?!.*test).*$/],
tracesSampleRate: 1.0,
transport: loggingTransport,
integrations: [Sentry.featureFlagsIntegration()],
});
const flagsIntegration = Sentry.getClient()?.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags');
Sentry.startSpan({ name: 'test-root-span' }, () => {
Sentry.startSpan({ name: 'test-span' }, () => {
Sentry.startSpan({ name: 'test-nested-span' }, () => {
for (let i = 1; i <= MAX_FLAGS_PER_SPAN; i++) {
flagsIntegration?.addFeatureFlag(`feat${i}`, false);
}
flagsIntegration?.addFeatureFlag(`feat${MAX_FLAGS_PER_SPAN + 1}`, true); // dropped flag
flagsIntegration?.addFeatureFlag('feat3', true); // update
});
});
});