Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deeper sentry next integration #2406

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .kontinuous/env/dev/templates/sentry.sealed-secret.yaml
17 changes: 17 additions & 0 deletions .kontinuous/env/preprod/templates/sentry.sealed-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: 'true'
name: sentry
spec:
encryptedData:
APP_SENTRY_DSN: AgBT64rndzgsE8FLNoGEkFBMeGbYIv0e7bDq13EEWRhP3AOpMTC9oLKMxzWzyU600x/n+Ofw8mABjvPSUHRucTL7lhOEiQqHRrvx9fZqpQRk2pRc+ZBNcD3zhEq2wFreukPXAnecg7JnqtyffJnUrS7K7D58AmDCvs6JFRmJoLIWutfcXTSXdza7J8p38nCJ7cFbiAo7ApleybqPHc1z2GZWDi3//Hu/JcEY5ZeOtJhzJqqKYjUQ23DXyJQMG+ELWZb871pEKVov4EfDncbfdaGc802PKwFAzQ/duiZbnAjRq2b8/AaqZNSxSGpQpDF2AfvVTHBBgyu4R1pJhBTs85ncKj5dwcGOokCoVv9iOY7OlgH0G8dLkjAN7qDRNVb2XQNldDFmGW8EITz3KF+kEs3CbaUWHcCDoSNnMhLaz9AMI16jqBpC04TJxj/jUYfNiMrz5VNiTuago0IPXiowvwBkwNyPBJV+VwmPpbxJmypyd5T5QLswJyJnbGMtc2cuKVXTpci+BmjTbiWmT2wsDEmCNbRzFcOyFkzS5vt/q+pc4rPRzP7pJ503NMsrZhD4h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: 'true'
name: sentry
type: Opaque
18 changes: 18 additions & 0 deletions .kontinuous/env/prod/templates/sentry.sealed-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
sealedsecrets.bitnami.com/namespace-wide: 'true'
name: sentry
namespace: egapro
spec:
encryptedData:
APP_SENTRY_DSN: AgADUFlo2fKI9dyEgTk4IrmzIc4gYimw1c9P6SJOBUcyycTAdWJeQxqvsJh8hFC/1LdGDAjnb1pVsjdG/EnUE+kSKwhZslV7tXNv+eD7kbv5od+xpw4l6Wely5h464w68WQmhv7LIm9XwMBMV17VfumUHrnc6rTVIdq4/BeJO03GF37b17lGUzsXA92j1tpLZtd0S8s14S9DGnLhFw6Ya0DrgfTmvIfC3CLgUu5oG7ps29shsk4MfQ7PYDCb1kFkbvMxajvmLc2rKIF1uV9rkK6MHrN8mqtaTJU9YuPsRvszste8q3j6dcOlvBok61BOiZzyJjLDfTRpZ5Ln5sNfKjahDFHFgpux1dW1mQSygOfCx6105myJ3TMTCsP/+W6QBUgnjlzF8LtZnlm28ex5zZt+DcRVgYEXY5p9Uql/0wRXR5Yq/N4geGTvxteRwdLLsfmYThZK7uGCy/8pOZDzwSmvpgG3GGdEO21y9904UNfy1ZtjYXkxaVlUlk5oHDvKMfj4hEYr9lAiPygfslOVqiyQ1fjv63Uis6YIkByniG3D3+7HRq7pqYgpwZrDK+dsWD125n6B1v44Rb7eDkH3WLJr7VN461fr7uFM9NeG0WgFk1ldtQkIDZxUyD/ye6S4J4eaWkc8N4LU6M58fnzIhcRjeMWe0Kj8gC8trQUpJlcnAXJxzSuWNalVIoSwHObb7lv2lYiZRp46hK8imVebxUGBV08sdfKusUUIxg+eur5f8fqM0iyxKuHEc0HzELUwX5kuWpwTWtTWby4zYskN8zCtB5CEp3pB3suw9Kk=
API_SENTRY_DSN: AgCRGSxKsWwaHO0j0EQnGGwJBJknPW5meEY+hEWcmgW6ECTtpNMg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5j03QjwjOtX7hYUFx9Kb0/fb+gc3U6/9G0iG1UgRwfphMC1bYe1Q6DF93nuwlCK/9lsZJffwaKEn+vehEz1f/Lo4MYkvpZcTC5LsQ2YPhSOsTAUY+qNrhGOhuBD7VfSvlXztOi7YcRMueozqeV3zM40InCxhcdGDcMYt8VD9hJzFzLYA5NMFbQXRKneC0FPzx6w9ueJm5GcxKl7py6v2DDODgBRbp2X01lcVGIawgTDUiPRnFB2LmVwaknZlcaNGZwKhgUEW5o4g2gDyTf93n4FUL6JlmSK20qJeWIeFNgNQGVrnlNfftJ/KhFfoqXS9sSQ9eqYg7CO9P69fkS3kPlo2VlB/unFYuGnHQxIKJqVNzpweiA3IwuKMrTVuXRWxO3GCF3uAaiZa5YcLnhWc3R8sF6c+9IzajOUPTP1TiDONIqbOPXo3e2ADiousKmztkzjwbQuvcfxA5IbQZIiQTKII2JnmlmtgaTNyr/6hvTNv3YHrJRIi+8Yvasih3ABrrzvK4Zlu8GCNOYBzvdTb2PCWgKN6Oy81gOTl1sVQq6S026iVxnK/PUqT6yFlqpFpg4GPHIkXGPaSzTmKHvMjAjld65XFNq8r4mwEgYKVc0JbTcNPpKgJ5rc3i/g7d4W3NVXAygZHS0xcs3o9JLzb5iKf4mk6oTQ2Q0/TkLa0kq+1/HQY9kl6qR9fZ8F9X7xt4SuYSEJKD7yfU63z8NVeY8ihsnOmcXwhJakg9beaC
template:
metadata:
annotations:
sealedsecrets.bitnami.com/namespace-wide: 'true'
name: sentry
type: Opaque
15 changes: 7 additions & 8 deletions .kontinuous/env/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
global:
host: egapro.travail.gouv.fr
sentryFront: "https://[email protected]/49"

api:
autoscale:
Expand All @@ -13,7 +12,13 @@ api:
cpu: 2
memory: 2G
vars:
EGAPRO_SENTRY_DSN: "https://[email protected]/22"
EGAPRO_SENTRY_DSN: "{{ .Values.global.sentry.apiDSN }}"
env:
- name: EGAPRO_SENTRY_DSN
valueFrom:
secretKeyRef:
name: sentry
key: API_SENTRY_DSN
envFrom:
- secretRef:
name: "{{ .Values.global.pgSecretName }}"
Expand Down Expand Up @@ -55,9 +60,3 @@ nginx:
autoscale:
enabled: true

jobs:
runs:
build-app:
with:
buildArgs:
REACT_APP_SENTRY_DSN: "{{ .Values.global.sentryFront }}"
41 changes: 35 additions & 6 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ app:
name: "moncomptepro"
- secretRef:
name: github-oauth
env:
- name: NEXT_PUBLIC_SENTRY_DSN
valueFrom:
secretKeyRef:
name: sentry
key: APP_SENTRY_DSN
vars:
POSTGRES_HOST: "$(PGHOST)"
POSTGRES_DB: "$(PGDATABASE)"
Expand All @@ -52,8 +58,7 @@ app:
POSTGRES_PASSWORD: "$(PGPASSWORD)"
POSTGRES_SSLMODE: "$(PGSSLMODE)"
SECURITY_JWT_SECRET: "$(EGAPRO_SECRET)"
SENTRY_DSN: "https://[email protected]/22"
EGAPRO_ENV: "{{ .Values.global.env }}"
NEXT_PUBLIC_EGAPRO_ENV: "{{ .Values.global.env }}"
NEXTAUTH_URL: "https://{{ .Values.global.host }}/api/auth"

nginx:
Expand All @@ -65,6 +70,7 @@ nginx:
paths:
- /
- /api/auth(/|$)(.*)
- /api/monitoring(/|$)(.*)
- /index-egapro/recherche(/|$)(.*)
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: *headers
Expand Down Expand Up @@ -108,14 +114,19 @@ api:
name: "staff"
- secretRef:
name: "egapro-secret"
env:
- name: EGAPRO_SENTRY_DSN
valueFrom:
secretKeyRef:
name: sentry
key: API_SENTRY_DSN
vars:
EGAPRO_DBHOST: "$(PGHOST)"
EGAPRO_DBNAME: "$(PGDATABASE)"
EGAPRO_DBPORT: "$(PGPORT)"
EGAPRO_DBUSER: "$(PGUSER)"
EGAPRO_DBPASS: "$(PGPASSWORD)"
EGAPRO_DBSSL: "$(PGSSLMODE)"
EGAPRO_SENTRY_DSN: "https://[email protected]/22"

pg:
~chart: pg
Expand Down Expand Up @@ -181,7 +192,10 @@ files:
- name: EGAPRO_DBSSL
value: "$(PGSSLMODE)"
- name: EGAPRO_SENTRY_DSN
value: "https://[email protected]/22"
valueFrom:
secretKeyRef:
name: sentry
key: API_SENTRY_DSN
- name: SCHEDULER
value: "True"
volumeMounts:
Expand Down Expand Up @@ -217,6 +231,12 @@ jobs:
use: build
memoryLimit: 14Gi
memoryRequest: 2Gi
env:
- name: NEXT_PUBLIC_SENTRY_DSN
valueFrom:
secretKeyRef:
name: sentry
key: APP_SENTRY_DSN
with:
imagePackage: app
dockerfile: packages/app/Dockerfile
Expand All @@ -225,7 +245,16 @@ jobs:
NEXT_PUBLIC_API_V2_URL: "https://{{ .Values.global.host }}/apiv2"
NEXTAUTH_URL: "https://{{ .Values.global.host }}/api/auth"
NEXT_PUBLIC_GITHUB_SHA: "{{ $.Values.global.shortSha }}"
EGAPRO_ENV: "{{ .Values.global.env }}"
NEXT_PUBLIC_EGAPRO_ENV: "{{ .Values.global.env }}"
NEXT_PUBLIC_SENTRY_DSN: "$NEXT_PUBLIC_SENTRY_DSN"
SENTRY_ORG: incubateur
SENTRY_PROJECT: egapro-app
SENTRY_URL: https://sentry2.fabrique.social.gouv.fr
SENTRY_RELEASE: "{{ .Values.global.isProd | ternary .Values.global.imageTag (.Values.global.isPreProd | ternary .Values.global.shortSha .Values.global.branchSlug32) }}"
secrets:
sentry_auth_token:
secretName: sentry
secretKey: SENTRY_AUTH_TOKEN

build-api:
use: build
Expand All @@ -243,4 +272,4 @@ jobs:
use: build
with:
imagePackage: files
context: packages/files
context: packages/files
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
4 changes: 0 additions & 4 deletions packages/app/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,4 @@ SECURITY_GITHUB_CLIENT_ID=
SECURITY_GITHUB_CLIENT_SECRET=
SECURITY_CHARON_URL="https://egapro-charon.ovh.fabrique.social.gouv.fr"

## Sentry
# old EGAPRO_SENTRY_DSN
SENTRY_DSN=""
# old EGAPRO_FLAVOUR
EMAIL_LOGIN=true
4 changes: 0 additions & 4 deletions packages/app/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,3 @@ SECURITY_GITHUB_CLIENT_ID=
SECURITY_GITHUB_CLIENT_SECRET=
SECURITY_CHARON_URL="https://egapro-charon.ovh.fabrique.social.gouv.fr"

## Sentry
# old EGAPRO_SENTRY_DSN
SENTRY_DSN=""
# old EGAPRO_FLAVOUR
5 changes: 0 additions & 5 deletions packages/app/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,3 @@ SECURITY_JWT_SECRET="sikretfordevonly"
SECURITY_JWT_ALGORITHM="HS256"
# old EGAPRO_ALLOWED_IPS
SECURITY_ALLOWED_IPS=""

## Sentry
# old EGAPRO_SENTRY_DSN
SENTRY_DSN=""
# old EGAPRO_FLAVOUR
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
37 changes: 26 additions & 11 deletions packages/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ ARG NODE_VERSION=20-alpine
# Builder
FROM node:$NODE_VERSION AS builder

ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL $NEXT_PUBLIC_API_URL
ARG NEXT_PUBLIC_API_V2_URL
ENV NEXT_PUBLIC_API_V2_URL $NEXT_PUBLIC_API_V2_URL
ARG NEXT_PUBLIC_GITHUB_SHA
ENV NEXT_PUBLIC_GITHUB_SHA $NEXT_PUBLIC_GITHUB_SHA
ARG EGAPRO_ENV
ENV EGAPRO_ENV $EGAPRO_ENV
ARG NEXTAUTH_URL
ENV NEXTAUTH_URL $NEXTAUTH_URL

WORKDIR /app

Expand All @@ -24,7 +14,31 @@ COPY packages/app/ ./packages/app/

ENV NODE_OPTIONS="--max-old-space-size=8192"

RUN yarn workspace app build
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL $NEXT_PUBLIC_API_URL
ARG NEXT_PUBLIC_API_V2_URL
ENV NEXT_PUBLIC_API_V2_URL $NEXT_PUBLIC_API_V2_URL
ARG NEXT_PUBLIC_GITHUB_SHA
ENV NEXT_PUBLIC_GITHUB_SHA $NEXT_PUBLIC_GITHUB_SHA
ARG NEXT_PUBLIC_EGAPRO_ENV
ENV NEXT_PUBLIC_EGAPRO_ENV $NEXT_PUBLIC_EGAPRO_ENV
ARG NEXTAUTH_URL
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

RUN yarn workspaces focus app --production && yarn cache clean
RUN mkdir -p ./packages/app/node_modules

Expand All @@ -43,6 +57,7 @@ COPY --from=builder /app/packages/app/.env.development .
COPY --from=builder /app/packages/app/public ./public
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/packages/app/node_modules ./packages/app/node_modules
COPY --from=builder /app/packages/app/sentry.*.ts .
COPY --from=builder --chown=node:node /app/packages/app/.next ./.next

USER 1000
Expand Down
41 changes: 34 additions & 7 deletions packages/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,37 @@ module.exports = nextConfig;
// Injected content via Sentry wizard below

const { withSentryConfig } = require("@sentry/nextjs");
const Sentry = require("@sentry/nextjs");

module.exports = withSentryConfig(
module.exports,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Clean output before source map upload
cleanArtifacts: true,

// Enable debug IDs
injectDebugIds: true,

// Enable source map uploading
sourcemaps: {
assets: "./**/*.{js,map}",
ignore: ["node_modules/**/*"],
deleteSourcemapsAfterUpload: true,
},

org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
url: process.env.SENTRY_URL,
authToken: process.env.SENTRY_AUTH_TOKEN,

// Enable debug mode for more verbose output
debug: true,

// Suppresses source map uploading logs during build
silent: true,
org: "incubateur",
project: "egapro-next",
url: "https://sentry.fabrique.social.gouv.fr/",
// silent: true,
},
{
// For all available options, see:
Expand All @@ -99,15 +118,23 @@ module.exports = withSentryConfig(
// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers and CORS issues
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,

// Enable release injection and component names
release: {
inject: true,
name: process.env.SENTRY_RELEASE || process.env.NEXT_PUBLIC_GITHUB_SHA || "dev",
},
includeNames: true,
autoInstrumentServerFunctions: false,

// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
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.92.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
Loading
Loading