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.

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 14:39:44 UTC

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!

Photo of Ankit
Ankit
Tue, 02 May 2023 15:35:42 UTC

> 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?

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 15:36:20 UTC

Ankit thats great news! Thanks for the reply.

Photo of Ankit
Ankit
Tue, 02 May 2023 15:36:23 UTC

> 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

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 15:37:59 UTC

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)

Photo of Ankit
Ankit
Tue, 02 May 2023 15:45:34 UTC

okay... cc vishal-signoz

Photo of Srikanth
Srikanth
Tue, 02 May 2023 16:11:02 UTC

Just by the looks of it, you are probably using FastAPI, see

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 16:11:34 UTC

You are right, thank you so much my friend, will try it! Srikanth :pray:

Photo of Srikanth
Srikanth
Tue, 02 May 2023 16:12:08 UTC

> 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.

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 16:13:33 UTC

Srikanth yes, thats what I’ve meant

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 16:27:54 UTC

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

Photo of vishal-signoz
vishal-signoz
Tue, 02 May 2023 16:31:30 UTC

Aleksandar Try `^/$` It should only match `/` route

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 16:47:33 UTC

tried it, it excluded all of the routes except the healthcheck one, so basically opposite of what I was heading towards to vishal-signoz

Photo of vishal-signoz
vishal-signoz
Tue, 02 May 2023 16:57:16 UTC

Strange, `^/$` is regex to match only `/` Can you set `OTEL_PYTHON_FASTAPI_EXCLUDED_URLS="^/$"`

Photo of vishal-signoz
vishal-signoz
Tue, 02 May 2023 16:58:03 UTC

I tested this regex:

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 17:01:02 UTC

I’ll test the `OTEL_PYTHON_FASTAPI_EXCLUDED_URLS` in a few minutes. One thing that crossed my mind from - 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?

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 17:24:20 UTC

`OTEL_PYTHON_FASTAPI_EXCLUDED_URLS` behaving exactly the same

Photo of Srikanth
Srikanth
Tue, 02 May 2023 17:42:40 UTC

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.

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 17:47:41 UTC

that is probably the best approach. Thanks for the help Srikanth vishal-signoz

Photo of Aleksandar
Aleksandar
Tue, 02 May 2023 20:50:23 UTC

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 (`: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!