django integration: fitering transactions by url #1569
Answered
by
sl0thentr0py
etienne-lebrun
asked this question in
Q&A
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 |
Answered by
sl0thentr0py
Aug 16, 2022
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 |
1 reply
Answer selected by
sl0thentr0py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi @etienne-lebrun, for WSGI we include the
wsgi_environobject insidesampling_context, so you can access the underlying request fields. Something like the following should work.