-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathscenario.ts
More file actions
29 lines (23 loc) · 917 Bytes
/
scenario.ts
File metadata and controls
29 lines (23 loc) · 917 Bytes
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
29
import * as Sentry from '@sentry/node-core';
import { loggingTransport } from '@sentry-internal/node-integration-tests';
import { setupOtel } from '../../../../utils/setupOtel';
const client = Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
tracesSampleRate: 1.0,
traceLifecycle: 'stream',
integrations: [Sentry.spanStreamingIntegration()],
transport: loggingTransport,
});
setupOtel(client);
Sentry.startSpan({ name: 'test-span', op: 'test' }, segmentSpan => {
Sentry.startSpan({ name: 'test-child-span', op: 'test-child' }, () => {
// noop
});
const inactiveSpan = Sentry.startInactiveSpan({ name: 'test-inactive-span' });
inactiveSpan.addLink({ context: segmentSpan.spanContext(), attributes: { 'sentry.link.type': 'some_relation' } });
inactiveSpan.end();
Sentry.startSpanManual({ name: 'test-manual-span' }, span => {
span.end();
});
});
void Sentry.flush();