Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sentry_config.js « sentry « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ed8a55b7d44760410ad22ddc399d5b9722576932 (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 * as Sentry from 'sentrybrowser7';
import { IGNORE_ERRORS, DENY_URLS, SAMPLE_RATE } from './constants';

const SentryConfig = {
  init(options = {}) {
    this.options = options;

    this.configure();
    if (this.options.currentUserId) this.setUser();
  },

  configure() {
    const { dsn, release, tags, allowUrls, environment } = this.options;

    Sentry.init({
      dsn,
      release,
      allowUrls,
      environment,
      ignoreErrors: IGNORE_ERRORS,
      denyUrls: DENY_URLS,
      sampleRate: SAMPLE_RATE,
    });

    Sentry.setTags(tags);
  },

  setUser() {
    Sentry.setUser({
      id: this.options.currentUserId,
    });
  },
};

export default SentryConfig;