chore(debug): endpoint /api/v1/_debug/sentry-test pour valider Sentry E2E
All checks were successful
Build & Deploy API / build-and-deploy (push) Successful in 1m17s
All checks were successful
Build & Deploy API / build-and-deploy (push) Successful in 1m17s
Endpoint qui throw délibérément pour tester :
- Capture côté Sentry (handler.ts:report)
- Release tag (APP_VERSION = sha git)
- Sourcemaps désobfusquées
- Tags { url=pattern, method, status }
- User context (si auth présente)
Gardé par NODE_ENV !== 'production' OU DEBUG_SENTRY_TEST=true.
Sur prod, activer le temps du test via :
kubectl -n rubis set env deploy/rubis-api DEBUG_SENTRY_TEST=true
curl -i https://app.rubis.pro/api/v1/_debug/sentry-test
# → 500, vérifier Sentry
kubectl -n rubis set env deploy/rubis-api DEBUG_SENTRY_TEST-
À retirer (revert ce commit) une fois l'intégration Sentry validée.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
f33b2dd319
commit
f59b11f836
@ -22,6 +22,19 @@ router
|
||||
* le init-container migrate.
|
||||
*/
|
||||
router.get('health', () => ({ status: 'ok', uptime: process.uptime() })).as('health')
|
||||
|
||||
/**
|
||||
* Sentry test trigger — endpoint debug qui throw délibérément pour
|
||||
* vérifier l'E2E observability (capture, release tag, sourcemaps,
|
||||
* user context). Disponible UNIQUEMENT si NODE_ENV !== 'production'
|
||||
* OU si DEBUG_SENTRY_TEST=true. À retirer une fois l'intégration
|
||||
* validée sur la prod.
|
||||
*/
|
||||
if (process.env.NODE_ENV !== 'production' || process.env.DEBUG_SENTRY_TEST === 'true') {
|
||||
router.get('_debug/sentry-test', () => {
|
||||
throw new Error(`Sentry test from rubis-api — ${new Date().toISOString()}`)
|
||||
})
|
||||
}
|
||||
})
|
||||
.prefix('/api/v1')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user