Skip to content

Commit d5be946

Browse files
committed
First pass at adding sentry exception tracking to this ReactJS webstore application, I have already added the env variable value for SENTRY_DSN into the repositories ci/cd env variables under staging
1 parent 11f8201 commit d5be946

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

charts/webstore/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ spec:
5050
value: "{{ .Values.clientSecret }}"
5151
- name: CLIENT_ID
5252
value: "{{ .Values.clientId }}"
53+
- name: SENTRY_DSN
54+
value: "{{ .Values.sentryDsn }}"
5355
ports:
5456
- name: http
5557
containerPort: {{ .Values.service.port }}

ops/staging-deploy.tmpl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ nextPublicToken: $NEXT_PUBLIC_TOKEN
77
nextAuthSecret: $NEXTAUTH_SECRET
88
clientSecret: $CLIENT_SECRET
99
clientId: $CLIENT_ID
10-
10+
sentryDsn: $SENTRY_DSN
1111
replicaCount: 1
1212

1313
image:

pages/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ import {
1818
ABOUT_US_TITLE,
1919
APP_TITLE,
2020
} from '../utils'
21+
import { Integrations } from "@sentry/tracing";
22+
import * as Sentry from "@sentry/react";
23+
24+
Sentry.init({
25+
dsn: process.env.SENTRY_DSN,
26+
integrations: [
27+
new Integrations.BrowserTracing(),
28+
],
29+
tracesSampleRate: 1.0,
30+
});
2131

2232
const Home = () => {
2333
const router = useRouter()

0 commit comments

Comments
 (0)