How to ignore healthcheck endpoint from transactions/performance metrics

Hi, we use Django application with Google Cloud Kubernetes Engine.
We have many pods, and liveness probes that calls
/healthcheck
endpoints.
Can we exclude it from transactions/performance metrics, to not pay for hundred thousands transactions every day, that’s not needed in sentry?

I can’t find it in Python/Django configuration documentation

hey @fonar,

please use this for now:

with configure_scope() as scope:
    if scope.transaction:
        scope.transaction.sampled = False

you can run this at any point in time during the request to prevent the transaction from being sampled

@untitaker I tried this with v0.17.4 and got the following error:

AttributeError: 'NoneType' object has no attribute 'sampled'
  File "django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "ll/apps/core/middleware.py", line 8, in middleware
    scope.transaction.sampled = False

I updated my answer, I think you’re using something other than traces_sample_rate=1.0 then?

1 Like

Yep! Thanks for the update.

How can i ignore health check endpoint from transactions in the nodejs sentry ?