Skip to content

Commit

Permalink
sentry config set environment
Browse files Browse the repository at this point in the history
  • Loading branch information
tdjsnelling committed Feb 9, 2023
1 parent 2c8be2f commit 9b7d144
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM node:16-alpine
ENV NODE_ENV=production
LABEL org.opencontainers.image.source=https://github.com/tdjsnelling/sqtracker
WORKDIR /sqtracker/app
COPY . .
Expand Down
2 changes: 2 additions & 0 deletions api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ validateConfig()
Sentry.init({
dsn: 'https://[email protected]/4504645996576768',
tracesSampleRate: 1.0,
environment:
process.env.NODE_ENV === 'production' ? 'production' : 'development',
})

Sentry.setContext('deployment', {
Expand Down
2 changes: 2 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM node:16-alpine AS builder
ARG SENTRY_AUTH_TOKEN
ENV NODE_ENV=production
ENV SENTRY_ORG=tdjsnelling
ENV SENTRY_PROJECT=sqtracker-frontend
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
Expand All @@ -10,6 +11,7 @@ RUN echo "{}" > /config.js
RUN ./node_modules/.bin/next build

FROM node:16-alpine
ENV NODE_ENV=production
LABEL org.opencontainers.image.source=https://github.com/tdjsnelling/sqtracker
WORKDIR /sqtracker/client
COPY --from=builder /sqtracker/node_modules ./node_modules
Expand Down
2 changes: 2 additions & 0 deletions client/sentry.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import config from '../config'
Sentry.init({
dsn: 'https://[email protected]/4504646040616960',
tracesSampleRate: 1.0,
environment:
process.env.NODE_ENV === 'production' ? 'production' : 'development',
})

Sentry.setContext('deployment', {
Expand Down
2 changes: 2 additions & 0 deletions client/sentry.edge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import config from '../config'
Sentry.init({
dsn: 'https://[email protected]/4504646040616960',
tracesSampleRate: 1.0,
environment:
process.env.NODE_ENV === 'production' ? 'production' : 'development',
})

Sentry.setContext('deployment', {
Expand Down
2 changes: 2 additions & 0 deletions client/sentry.server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import config from '../config'
Sentry.init({
dsn: 'https://[email protected]/4504646040616960',
tracesSampleRate: 1.0,
environment:
process.env.NODE_ENV === 'production' ? 'production' : 'development',
})

Sentry.setContext('deployment', {
Expand Down

0 comments on commit 9b7d144

Please sign in to comment.