mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-25 02:54:01 +03:00
Add environment and traces_sample_rate keyword to sentry_sdk.init
This commit is contained in:
parent
4cbdc21515
commit
688739cb39
|
@ -49,6 +49,8 @@ DJANGO_AWS_S3_CUSTOM_DOMAIN AWS_S3_CUSTOM_DOMAIN n/a
|
|||
DJANGO_GCP_STORAGE_BUCKET_NAME GS_BUCKET_NAME n/a raises error
|
||||
GOOGLE_APPLICATION_CREDENTIALS n/a n/a raises error
|
||||
SENTRY_DSN SENTRY_DSN n/a raises error
|
||||
SENTRY_ENVIRONMENT n/a n/a production
|
||||
SENTRY_TRACES_SAMPLE_RATE n/a n/a 0.0
|
||||
DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO
|
||||
MAILGUN_API_KEY MAILGUN_API_KEY n/a raises error
|
||||
MAILGUN_DOMAIN MAILGUN_SENDER_DOMAIN n/a raises error
|
||||
|
|
|
@ -353,13 +353,17 @@ sentry_logging = LoggingIntegration(
|
|||
)
|
||||
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
integrations = [sentry_logging, DjangoIntegration(), CeleryIntegration()]
|
||||
{% else %}
|
||||
integrations = [sentry_logging, DjangoIntegration()]
|
||||
{% endif -%}
|
||||
|
||||
sentry_sdk.init(
|
||||
dsn=SENTRY_DSN,
|
||||
integrations=[sentry_logging, DjangoIntegration(), CeleryIntegration()],
|
||||
integrations=integrations,
|
||||
environment=env("SENTRY_ENVIRONMENT", default="production"),
|
||||
traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE", default=0.0),
|
||||
)
|
||||
{% else %}
|
||||
sentry_sdk.init(dsn=SENTRY_DSN, integrations=[sentry_logging, DjangoIntegration()])
|
||||
{% endif -%}
|
||||
{% endif %}
|
||||
# Your stuff...
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user