Sentry integration

This commit is contained in:
Silver Ghost 2022-11-15 12:45:50 +03:00
parent 17255b2e56
commit 6dbff3c3f0
No known key found for this signature in database
3 changed files with 35 additions and 21 deletions

View File

@ -60,27 +60,27 @@ services:
- "traefik.http.routers.later42-opt.tls.certresolver=myresolver"
- "extdns.cf.later42.hostname=later42.com"
# later42_tasks:
# build: .
# container_name: later42_tasks
# image: dntskdev/later42:master
# restart: always
# command: celery -A later42 worker --loglevel=info
# environment:
# SECRET: "ahth3chaquodahh6que8thie1EThe5Iephich8eikei2Uojaemae6gee0kaet4aush2aoqu0ruL9oGhaiR9luu7cohreH6lebo0v"
# DB_TYPE: postgres
# DB_HOST: later42db
# DB_NAME: later42
# DB_USER: later42
# DB_PASS: later42
# DOMAIN: later42.com
# READABILITY_HOST: http://ureadability:8080/
# REDIS_URL: redis://redis:6379
# logging:
# driver: json-file
# options:
# max-size: "10m"
# max-file: "5"
later42_tasks:
build: .
container_name: later42_tasks
image: dntskdev/later42:master
restart: always
command: celery -A later42 worker --loglevel=info
environment:
SECRET: "ahth3chaquodahh6que8thie1EThe5Iephich8eikei2Uojaemae6gee0kaet4aush2aoqu0ruL9oGhaiR9luu7cohreH6lebo0v"
DB_TYPE: postgres
DB_HOST: later42db
DB_NAME: later42
DB_USER: later42
DB_PASS: later42
DOMAIN: later42.com
READABILITY_HOST: http://ureadability:8080/
REDIS_URL: redis://redis:6379
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
later42db:
container_name: later42db

View File

@ -205,3 +205,16 @@ if AIRBRAKE['project_id'] is not None and AIRBRAKE['project_key'] is not None:
},
},
}
SENTRY_DSN=os.getenv('SENTRY_DSN', None)
if SENTRY_DSN is not None:
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration()],
traces_sample_rate=1.0,
send_default_pii=True,
)

View File

@ -9,3 +9,4 @@ psycopg2-binary==2.9.4
six==1.16.0
celery[redis]==5.2.7
pybrake==1.10.0
sentry-sdk==1.11.0