-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathinit.js
More file actions
28 lines (26 loc) · 762 Bytes
/
init.js
File metadata and controls
28 lines (26 loc) · 762 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
import * as Sentry from '@sentry/browser';
window.Sentry = Sentry;
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingIntegration(), Sentry.spanStreamingIntegration()],
tracesSampleRate: 1,
beforeSendSpan: Sentry.withStreamedSpan(span => {
if (span.attributes['sentry.op'] === 'pageload') {
span.name = 'customPageloadSpanName';
span.links = [
{
context: {
traceId: '123',
spanId: '456',
},
attributes: {
'sentry.link.type': 'custom_link',
},
},
];
span.attributes['sentry.custom_attribute'] = 'customAttributeValue';
span.status = 'something';
}
return span;
}),
});