django integration: fitering transactions by url #1569
-
Problem StatementI'm trying to reduce the noise in our transactions, by filtering out frequently reached but not interesting urls ( /health in my particular case) Solution BrainstormI tried to use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
hi @etienne-lebrun, for WSGI we include the IGNORED_URLS = ["/ignore/this/url"]
def traces_sampler(sampling_context):
path = sampling_context.get("wsgi_environ", {}).get("PATH_INFO", None)
if path and path in IGNORED_URLS:
return 0
else:
return 1 |
Beta Was this translation helpful? Give feedback.
hi @etienne-lebrun, for WSGI we include the
wsgi_environ
object insidesampling_context
, so you can access the underlying request fields. Something like the following should work.