#support

Show Only Traces in View & Exclude Certain Routes

TLDR Aleksandar wants to show only traces in traces view and exclude certain routes. Ankit confirms the feature is upcoming. Srikanth and vishal-signoz help exclude a healthcheck route using FastAPI.

Powered by Struct AI
+11
raised_hands1
20
5mo
Solved
Join the chat
May 02, 2023 (5 months ago)
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
02:39 PM
Hi, is it possible to show only traces in the traces view, by default Signoz shows both traces and their spans which makes it a bit hard for me to find the information that I need (screenshot for a reference). Also, is it possible to exclude certain routes, as I have healthcheck route which is triggered every few seconds and unnecessarily bloats the view. Thanks!
Image 1 for Hi, is it possible to show only traces in the traces view, by default Signoz shows both traces and their spans which makes it a bit hard for me to find the information that I need (screenshot for a reference). Also, is it possible to exclude certain routes, as I have healthcheck route which is triggered every few seconds and unnecessarily bloats the view. Thanks!
Ankit
Photo of md5-dbe7088320fe1d922707613e02f3420d
Ankit
03:35 PM
> is it possible to show only traces in the traces view
This is upcoming in a month. We are launching a new explorer page with that option

> is it possible to exclude certain routes, as I have healthcheck route which is triggered every few seconds and unnecessarily bloats the view
should be possible. Srikanth can you help?
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
03:36 PM
Ankit thats great news! Thanks for the reply.
Ankit
Photo of md5-dbe7088320fe1d922707613e02f3420d
Ankit
03:36 PM
> which makes it a bit hard for me to find the information that I need
What data that you need to view for traces and not spans? Would be helpful to understand. Aleksandar
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
03:37 PM
ideally I would be able to toggle to show/hide the spans in the list shown on /trace , so when needed I can see only the traces without the spans, and then when I want to see spans of the specific trace I click on it to open the detailed view (trace details page)
Ankit
Photo of md5-dbe7088320fe1d922707613e02f3420d
Ankit
03:45 PM
okay... cc vishal-signoz
+11
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
04:11 PM
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
04:11 PM
You are right, thank you so much my friend, will try it! Srikanth 🙏
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
04:12 PM
> so when needed I can see only the traces without the spans
by this do you mean root span? since trace is really a bunch of spans.
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
04:13 PM
Srikanth yes, thats what I’ve meant
04:27
Aleksandar
04:27 PM
Srikanth the URL exclude list seems to be working, the only issue is that my healthcheck is on the / route, and I’m not sure which value should I set to exclude only that URL and not any other. With value OTEL_PYTHON_EXCLUDED_URLS=/ It excludes all root spans for all urls
vishal-signoz
Photo of md5-f936d3e5743d23344d6c60813189716f
vishal-signoz
04:31 PM
Aleksandar Try ^/$
It should only match / route
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
04:47 PM
tried it, it excluded all of the routes except the healthcheck one, so basically opposite of what I was heading towards to vishal-signoz
vishal-signoz
Photo of md5-f936d3e5743d23344d6c60813189716f
vishal-signoz
04:57 PM
Strange, ^/$ is regex to match only /
Can you set OTEL_PYTHON_FASTAPI_EXCLUDED_URLS="^/$"
04:58
vishal-signoz
04:58 PM
I tested this regex: https://regex101.com/r/lrtXtU/1
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
05:01 PM
I’ll test the OTEL_PYTHON_FASTAPI_EXCLUDED_URLS in a few minutes. One thing that crossed my mind from https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/fastapi/fastapi.html#exclude-lists - it seems like they are not including the trailing slashes in the values, for example they wrote that in order to exclude /healthcheck route you need to set value OTEL_PYTHON_FASTAPI_EXCLUDED_URLS=healtcheck which does not include the / , could that be the problem?
05:24
Aleksandar
05:24 PM
OTEL_PYTHON_FASTAPI_EXCLUDED_URLS behaving exactly the same
Image 1 for <code>OTEL_PYTHON_FASTAPI_EXCLUDED_URLS</code> behaving exactly the same
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
05:42 PM
Yes, it doesn’t include the trailing slash. I recommend you to some straightforward endpoint like /healthz or /healthcheck and exclude it instead of the root URL.
Aleksandar
Photo of md5-fcc1fcdad98a2b2700e6642fd4a47f9f
Aleksandar
05:47 PM
that is probably the best approach. Thanks for the help Srikanth vishal-signoz
08:50
Aleksandar
08:50 PM
Srikanth vishal-signoz I was able to actually solve it with the following value for excluded URLs: ^(https?://)?[^/]+(/)?$

The regex ^/$ would have worked if the url that was passed to the validation function was only relative (/), but instead its the full URL (<http://server>:port/) and requires the above regex in order to properly filter out the / URL.

Thanks for the guidance, much appreciated! I love Signoz and will start using it in prod very soon!
raised_hands1