debian-mirror-gitlab/app/assets/javascripts/sentry/sentry_config.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
528 B
JavaScript
Raw Normal View History

2023-03-04 22:38:38 +05:30
import * as Sentry from 'sentrybrowser7';
2017-08-17 22:00:37 +05:30
2019-12-26 22:10:19 +05:30
const SentryConfig = {
2017-08-17 22:00:37 +05:30
init(options = {}) {
this.options = options;
this.configure();
if (this.options.currentUserId) this.setUser();
},
configure() {
2023-03-04 22:38:38 +05:30
const { dsn, release, tags, allowUrls, environment } = this.options;
2021-09-30 23:02:18 +05:30
2019-12-26 22:10:19 +05:30
Sentry.init({
dsn,
release,
2023-03-04 22:38:38 +05:30
allowUrls,
2019-12-26 22:10:19 +05:30
environment,
});
2021-09-30 23:02:18 +05:30
Sentry.setTags(tags);
2017-08-17 22:00:37 +05:30
},
setUser() {
2019-12-26 22:10:19 +05:30
Sentry.setUser({
2017-08-17 22:00:37 +05:30
id: this.options.currentUserId,
});
},
};
2019-12-26 22:10:19 +05:30
export default SentryConfig;