Skip to content

Commit

Permalink
fix: up sentry + fixing sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jan 28, 2025
1 parent 2a63693 commit b2b6848
Show file tree
Hide file tree
Showing 9 changed files with 1,318 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
Expand Down
2 changes: 1 addition & 1 deletion packages/app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const config = {
extends: [
"eslint:recommended",
"next/core-web-vitals",
// default rules for import
"plugin:import/recommended",
"plugin:import/typescript",
// include prettier config which avoid conflict
"prettier",
// disable conflicting rules with plugin (not config!)
Expand Down
2 changes: 2 additions & 0 deletions packages/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ ENV NEXTAUTH_URL $NEXTAUTH_URL
ARG SENTRY_URL
ARG SENTRY_ORG
ARG SENTRY_PROJECT
ARG SENTRY_RELEASE
ARG NEXT_PUBLIC_SENTRY_DSN
ENV SENTRY_URL=$SENTRY_URL
ENV SENTRY_ORG=$SENTRY_ORG
ENV SENTRY_PROJECT=$SENTRY_PROJECT
ENV NEXT_PUBLIC_SENTRY_DSN=$NEXT_PUBLIC_SENTRY_DSN
ENV SENTRY_RELEASE=$SENTRY_RELEASE

RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN=$(cat /run/secrets/sentry_auth_token); \
yarn workspace app build
Expand Down
9 changes: 5 additions & 4 deletions packages/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ module.exports = withSentryConfig(
project: process.env.SENTRY_PROJECT,
url: process.env.SENTRY_URL,
authToken: process.env.SENTRY_AUTH_TOKEN,
release: {
name: process.env.SENTRY_RELEASE,
release: process.env.SENTRY_RELEASE,
setCommits: {
auto: true,
},
},
{
Expand All @@ -107,8 +108,8 @@ module.exports = withSentryConfig(
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,
// Don't hide source maps from generated client bundles
hideSourceMaps: false,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@json2csv/node": "^7.0.1",
"@octokit/rest": "^20.0.2",
"@react-pdf/renderer": "^3.1.12",
"@sentry/nextjs": "^7.106.0",
"@sentry/nextjs": "^8.51.0",
"@socialgouv/matomo-next": "^1.8.0",
"chart.js": "^4.3.0",
"chartjs-plugin-datalabels": "^2.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/app/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";
import { Replay } from "@sentry/replay";
import { replayIntegration } from "@sentry/nextjs";

const ENVIRONMENT = process.env.NEXT_PUBLIC_EGAPRO_ENV || "development";
const IS_PRODUCTION = ENVIRONMENT === "production";
Expand All @@ -23,7 +23,7 @@ Sentry.init({
enableTracing: true,

// Track releases for better error monitoring
release: process.env.NEXT_PUBLIC_GITHUB_SHA || "development",
release: process.env.SENTRY_RELEASE || process.env.NEXT_PUBLIC_GITHUB_SHA || ENVIRONMENT,

beforeSend(event) {
// Filter out non-error events in production
Expand Down Expand Up @@ -53,7 +53,7 @@ Sentry.init({
},

integrations: [
new Replay({
replayIntegration({
maskAllText: true,
blockAllMedia: true,
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/app/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Sentry.init({
enableTracing: true,

// Track releases for better error monitoring
release: process.env.NEXT_PUBLIC_GITHUB_SHA || ENVIRONMENT,
release: process.env.SENTRY_RELEASE || process.env.NEXT_PUBLIC_GITHUB_SHA || ENVIRONMENT,

beforeSend(event) {
// Filter out non-error events in production
Expand Down
2 changes: 1 addition & 1 deletion packages/app/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Sentry.init({
enableTracing: true,

// Track releases for better error monitoring
release: process.env.NEXT_PUBLIC_GITHUB_SHA || ENVIRONMENT,
release: process.env.SENTRY_RELEASE || process.env.NEXT_PUBLIC_GITHUB_SHA || ENVIRONMENT,

beforeSend(event) {
// Filter out non-error events in production
Expand Down
Loading

0 comments on commit b2b6848

Please sign in to comment.