feat: Sentry in the API, the worker, the Site and the Kanban (off until the DSNs are set)
app/observability.py starts sentry-sdk for the API and the worker when SENTRY_DSN_API is set, with send_default_pii off and a scrub that strips cookies, tokens, bodies, CPF/CNPJ and e-mails. The browser loads the official Sentry bundle from our own origin (web/vendor, provenance in its README) and starts with SENTRY_DSN_WEB from /api/session or /api/operator/me; every failed API answer the customer or the team gets is reported with its path, status and message, never the request body. The CSP allows Blyzer's Sentry ingest host. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,10 @@ x-app-environment: &app-environment
|
||||
# connection per `with` block, exactly as before (the production default).
|
||||
DB_POOL: ${DB_POOL:-off}
|
||||
DB_POOL_SIZE: ${DB_POOL_SIZE:-20}
|
||||
# Sentry: empty DSNs leave it off; the environment defaults to production.
|
||||
SENTRY_DSN_API: ${SENTRY_DSN_API:-}
|
||||
SENTRY_DSN_WEB: ${SENTRY_DSN_WEB:-}
|
||||
SENTRY_ENVIRONMENT: ${SENTRY_ENVIRONMENT:-production}
|
||||
S3_ENDPOINT: ${R2_ENDPOINT:?set R2_ENDPOINT}
|
||||
S3_PUBLIC_ENDPOINT: ${R2_ENDPOINT:?set R2_ENDPOINT}
|
||||
S3_BUCKET: ${R2_BUCKET:?set R2_BUCKET}
|
||||
@@ -301,6 +305,8 @@ services:
|
||||
# Mercado Pago's card form loads from these origins; empty keeps the
|
||||
# Site at script-src 'self'. Set together with the Mercado Pago adapter.
|
||||
PAYMENT_CSP_SOURCES: ${PAYMENT_CSP_SOURCES:-}
|
||||
# The Sentry ingest origin(s) for connect-src; empty until the DSN exists.
|
||||
SENTRY_CSP_SOURCES: ${SENTRY_CSP_SOURCES:-https://o4510863040905216.ingest.us.sentry.io}
|
||||
# The bank's confirmation page for debit and other 3-D Secure cards is
|
||||
# on the issuer's own domain, so it cannot be listed: "https:" lets
|
||||
# frames and form posts reach it (never scripts). Empty turns it off.
|
||||
@@ -329,6 +335,8 @@ services:
|
||||
S3_PUBLIC_ENDPOINT: ${R2_ENDPOINT:?set R2_ENDPOINT}
|
||||
PAYMENT_CSP_SOURCES: ""
|
||||
PAYMENT_CHALLENGE_SOURCES: ""
|
||||
# The Kanban reports to Sentry too; set from the browser DSN host.
|
||||
SENTRY_CSP_SOURCES: ${SENTRY_CSP_SOURCES:-https://o4510863040905216.ingest.us.sentry.io}
|
||||
networks: [backend]
|
||||
ports:
|
||||
- target: 8080
|
||||
|
||||
Reference in New Issue
Block a user