Skip to content

Commit

Permalink
feat: add datadog for experiment purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Aug 19, 2022
1 parent 6cf29b7 commit faccac4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@capacitor/ios": "^3.5.0",
"@capacitor/share": "^1.1.2",
"@capacitor/splash-screen": "^1.2.2",
"@datadog/browser-rum": "^4.17.2",
"@sentry/integrations": "^5.6.1",
"@sentry/tracing": "^6.18.1",
"@sentry/vue": "^6.18.1",
Expand Down
18 changes: 18 additions & 0 deletions src/injections/datadog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import config from '@/config';
import { datadogRum } from "@datadog/browser-rum";

datadogRum.init({
applicationId: "8389e11f-c265-4e26-b593-714a0715ee23",
clientToken: "pub8e917141fb2fbe2762f2fc70e3e2f0bb",
site: "datadoghq.com",
service: "penguin-statistics",

// Specify a version number to identify the deployed version of your application in Datadog
version: config.version,
sampleRate: 10,
premiumSampleRate: 1,
trackInteractions: true,
defaultPrivacyLevel: "allow",
});

datadogRum.startSessionReplayRecording();
5 changes: 3 additions & 2 deletions src/injections/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import './datadog'
import './directives'
import './filters'
import './googleAnalytics'
import './sentry'
import './filters'
import './directives'
import './virtualScroller'

import Vue from 'vue'
Expand Down
8 changes: 4 additions & 4 deletions src/injections/sentry.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";
import config from "@/config";
import router from "@/router";
import environment from "@/utils/environment";
import { BrowserTracing } from "@sentry/tracing";
import * as Sentry from "@sentry/vue";
import Vue from "vue";
import router from "@/router";

// const sentEvents = {};

Expand All @@ -29,7 +29,7 @@ if (environment.production) {
"StatsByItem",
"StageSelector",
],
tracesSampleRate: environment.production ? 0.05 : 1.0,
tracesSampleRate: environment.production ? 0.005 : 1.0,
release:
(config.project || "unknown") + "@" + (config.version || "unknown"),
ignoreErrors: [
Expand Down
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,26 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"

"@datadog/browser-core@4.17.2":
version "4.17.2"
resolved "https://registry.yarnpkg.com/@datadog/browser-core/-/browser-core-4.17.2.tgz#c4a898f83aa3a988b3699ccae6c5fef2fb4c0619"
integrity sha512-ocitVzLN0cfwkd1x7r6wem6MfaUSu2o4icxUP43SjMeFZryQlT1B/j+OBv30fFMtKMW7GQFm/5Kq1Eu9KdqBrw==

"@datadog/browser-rum-core@4.17.2":
version "4.17.2"
resolved "https://registry.yarnpkg.com/@datadog/browser-rum-core/-/browser-rum-core-4.17.2.tgz#a552062521d4d5f1d36f9e4401144c862494645f"
integrity sha512-HwI4uOoYUr227g8lRXVfEE6yTFw6lIAmS+NcVPO5XYZCNtwz9tVj2L8eFwoG0HEhqtHGnwF4guokCH49FaSjuQ==
dependencies:
"@datadog/browser-core" "4.17.2"

"@datadog/browser-rum@^4.17.2":
version "4.17.2"
resolved "https://registry.yarnpkg.com/@datadog/browser-rum/-/browser-rum-4.17.2.tgz#39c73105d04c988e77b6466a9295cd0a162e9799"
integrity sha512-v3KShjSA643BYUAKNBGoKjwbPdMGuQrnCYdowCIy1AU1Bz3+ud+OgBHTBYyM0/M9esRYFeE+HcYLP/YnFbjVbQ==
dependencies:
"@datadog/browser-core" "4.17.2"
"@datadog/browser-rum-core" "4.17.2"

"@gar/promisify@^1.0.1":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
Expand Down

0 comments on commit faccac4

Please sign in to comment.