-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathscenario.ts
More file actions
22 lines (18 loc) · 797 Bytes
/
scenario.ts
File metadata and controls
22 lines (18 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import type { Scope } from '@sentry/node';
import * as Sentry from '@sentry/node';
import { loggingTransport } from '@sentry-internal/node-integration-tests';
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
sampleRate: 1.0,
transport: loggingTransport,
integrations: [Sentry.featureFlagsIntegration()],
});
const flagsIntegration = Sentry.getClient()?.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags');
flagsIntegration?.addFeatureFlag('shared', true);
Sentry.withScope((_scope: Scope) => {
flagsIntegration?.addFeatureFlag('forked', true);
flagsIntegration?.addFeatureFlag('shared', false);
Sentry.captureException(new Error('Error in forked scope'));
});
flagsIntegration?.addFeatureFlag('main', true);
throw new Error('Error in main scope');