== Monitoring et activités

[quote,Terry Pratchett,Les Anales du Disque-Monde]
Les magiciens du Disque-Monde ont, de leur côté, calculé que les chances uniques sur un million se produisent 9 fois sur 10.

[source,python]
----
SENTRY_DSN = env("SENTRY_DSN", default=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()],

        # Set traces_sample_rate to 1.0 to capture 100%
        # of transactions for performance monitoring.
        # We recommend adjusting this value in production.
        traces_sample_rate=1.0,

        # If you wish to associate users to errors (assuming you are using
        # django.contrib.auth) you may enable sending PII data.
        send_default_pii=True,
        ca_certs=<path_to_pem_file>,
    )
----
