Skip to content

Commit

Permalink
chore: Adds sentry APM (#4698)
Browse files Browse the repository at this point in the history
  • Loading branch information
divs4debu authored Aug 2, 2020
1 parent b9929ad commit dabf4bd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/config/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ declare const config: {
dsn: string;
debug: boolean;
development: boolean;
tracesSampleRate: number;
}
};
5 changes: 4 additions & 1 deletion app/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as Sentry from '@sentry/browser';
import { CaptureConsole, Dedupe, Ember } from '@sentry/integrations';
import config from 'open-event-frontend/config/environment';
import { Integrations as ApmIntegrations } from '@sentry/apm';

if (!config.sentry.dsn.includes('dummy')) {

Expand All @@ -10,8 +11,10 @@ if (!config.sentry.dsn.includes('dummy')) {
new Dedupe(),
new CaptureConsole({
levels: ['error']
})
}),
new ApmIntegrations.Tracing(),
],
tracesSampleRate: config.sentry.tracesSampleRate,
beforeSend(event: Sentry.Event) {
const exception = event.exception?.values?.[0];
const errorValue = exception?.value;
Expand Down
3 changes: 2 additions & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ module.exports = function(environment) {
sentry: {
dsn : process.env.SENTRY_DSN || 'https://dummy@getsentry.com/dummy',
debug : !!process.env.SENTRY_DSN,
development : !process.env.SENTRY_DSN
development : !process.env.SENTRY_DSN,
tracesSampleRate: process.env.SENTRY_TRACE_SAMPLE_RATE || 0.01,
},

emberFullCalendar: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@glimmer/component": "^1.0.1",
"@glimmer/tracking": "^1.0.1",
"@open-event/theme": "0.2.1-rounded",
"@sentry/apm": "^5.20.1",
"@sentry/browser": "^5.20.1",
"@sentry/integrations": "^5.20.1",
"@sentry/node": "^5.20.1",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@
resolved "https://registry.yarnpkg.com/@open-event/theme/-/theme-0.2.1-rounded.tgz#841d711fbbc1837c6ff009c1ed1288c2371a02a6"
integrity sha512-Kcanx/LjRkJrf6Y46Tb7nk3GIc11kSUJY6DqUN22PmiP+LSutAv0Xxhs400CXT7mST3H/mrMq+CgZC9zc2YHDw==

"@sentry/apm@5.20.1":
"@sentry/apm@5.20.1", "@sentry/apm@^5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.20.1.tgz#2126407ec8ecc6f78f42a8a8de99b90dec982036"
integrity sha512-oqfyYqRR1CaM/U5qZg3KY9MxCe4OWYs3uiOvVGMOHCyx50dYsDZziM5DDVUvi6pOuokLCNbyXO9xGROSmploBQ==
Expand Down

1 comment on commit dabf4bd

@vercel
Copy link

@vercel vercel bot commented on dabf4bd Aug 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.