feat(infra) : branche le SDK Sentry (back + front) vers GlitchTip + CA racine MALIO
Auto Tag Develop / tag (push) Successful in 14s

Error tracking centralise : remontee des erreurs back (Symfony) et front (Nuxt)
vers l'instance GlitchTip auto-hebergee. DSN vides par defaut => SDK inerte.

Backend :
- sentry/sentry-symfony ^5.10, bundle enregistre prod-only
- config/packages/sentry.yaml : handler Monolog niveau ERROR+, ignore 4xx/AccessDenied,
  pas d'APM, release = %app.version%
- .env : bloc SENTRY_DSN documente (vide => inerte)

Frontend :
- @sentry/nuxt ^10.61, module charge uniquement si NUXT_PUBLIC_SENTRY_DSN defini
- runtimeConfig.public.sentry + source maps (hidden) + options d'upload
- sentry.client.config.ts : init cote client gardee par if (dsn)

Deploiement :
- Dockerfile : ARG Sentry au build front (prefixe inline du RUN, token non persiste)
  + CA racine interne MALIO (update-ca-certificates) pour le handshake HTTPS GlitchTip back
- build-docker.yml : --build-arg depuis les secrets Gitea
- .env.prod.example : SENTRY_DSN (back, runtime)
This commit is contained in:
Matthieu
2026-06-29 17:43:35 +02:00
parent d1da48ea74
commit 6ee332757c
14 changed files with 1454 additions and 25 deletions
+22 -1
View File
@@ -40,12 +40,33 @@ export default defineNuxtConfig({
'nuxt-toast',
'@nuxtjs/i18n',
'@nuxt/icon',
// Error tracking → GlitchTip. Module charge uniquement si un DSN est fourni
// (build prod) ; en dev sans DSN, aucun overhead Sentry. Les options d'upload
// des source maps sont passees en ligne (fournies au build via secrets CI).
...(process.env.NUXT_PUBLIC_SENTRY_DSN
? [['@sentry/nuxt/module', {
sourceMapsUploadOptions: {
url: process.env.SENTRY_URL,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
},
}] as [string, Record<string, unknown>]]
: []),
],
runtimeConfig: {
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE
apiBase: process.env.NUXT_PUBLIC_API_BASE,
sentry: {
// DSN du projet GlitchTip "starseed-front" (vide => SDK inerte).
dsn: process.env.NUXT_PUBLIC_SENTRY_DSN || '',
environment: process.env.NODE_ENV || 'development',
},
}
},
// Source maps "hidden" : generees et uploadees vers GlitchTip pour des stacktraces
// lisibles, sans exposer les .map au navigateur.
sourcemap: {client: 'hidden'},
devServer: {
port: 3004,
},