blob: cf6a79fe939e8dfee64c12acd1c42a1517c2f964 (
plain)
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
30
31
32
33
34
35
|
import '../webpack';
import * as Sentry from 'sentrybrowser7';
import SentryConfig from './sentry_config';
const index = function index() {
// Configuration for newer versions of Sentry SDK (v7)
SentryConfig.init({
dsn: gon.sentry_dsn,
environment: gon.sentry_environment,
currentUserId: gon.current_user_id,
allowUrls:
process.env.NODE_ENV === 'production'
? [gon.gitlab_url]
: [gon.gitlab_url, 'webpack-internal://'],
release: gon?.version,
tags: {
revision: gon?.revision,
feature_category: gon?.feature_category,
page: document?.body?.dataset?.page,
},
});
};
index();
// The _Sentry object is globally exported so it can be used by
// ./sentry_browser_wrapper.js
// This hack allows us to load a single version of `@sentry/browser`
// in the browser, see app/views/layouts/_head.html.haml to find how it is imported.
// eslint-disable-next-line no-underscore-dangle
window._Sentry = Sentry;
export default index;
|