Issue with Signoz Tracer on Python FastAPI Application

TLDR Snehanshu is experiencing an issue with the Signoz tracer on a Python FastAPI application which involves a large number of irrelevant spans. vishal-signoz suggested verifying the relevance of these spans and questioned about the type of instrumentation used by Snehanshu.

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 04:24:33 UTC

Hi team, when I am using Signoz tracer to monitor a method in my Python FastAPI application which involves jpype library, there is huge numbr of traces coming up on the UI and also the UI hangs on opening up that particular request. Could anyone help me know why this is happening?

Photo of vishal-signoz
vishal-signoz
Thu, 17 Aug 2023 07:10:43 UTC

How many spans are there? The community edition supports upto 10k spans in a single trace. The enterprise plan has a feature which allows upto 100k spans in a single trace.

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:31:46 UTC

vishal-signoz 2998 spans coming up. However i have attached traces only to few methods. These many spans showing up when jpype is used. Other cases only the required number of spans show up. Is it normal behaviour or something is wrong from my code end?

Photo of vishal-signoz
vishal-signoz
Thu, 17 Aug 2023 07:32:39 UTC

Can you check if the spans are relevant?

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:33:03 UTC

No they are not relevant. they have time spans of 0.01 microseconds.

Photo of vishal-signoz
vishal-signoz
Thu, 17 Aug 2023 07:33:05 UTC

Our enterprise customers do have thousands of spans so depends on your system.

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:33:33 UTC

Outside of the main span which is actually required.

Photo of vishal-signoz
vishal-signoz
Thu, 17 Aug 2023 07:36:23 UTC

Are they duplicates? Can you their name and attributes?

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:36:24 UTC

If you see this screenshot, the upload span is the only required span, however the POST/ ones are in huge number coming up.

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:36:38 UTC

Yes they are duplicates the POST/ ones

Photo of vishal-signoz
vishal-signoz
Thu, 17 Aug 2023 07:38:02 UTC

I didn’t find any relevant github issues on jpype. How did you instrument?

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:39:02 UTC

from opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("file_response"):

Photo of vishal-signoz
vishal-signoz
Thu, 17 Aug 2023 07:39:28 UTC

So you are manually instrumenting?

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:39:45 UTC

Yes within each method which i want to be monitored. Usig this. with tracer.start_as_current_span("file_response"):

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:41:24 UTC

There is a nested method calls which comes up perfectly as in the screenshot marked with 7, upload.

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 07:41:54 UTC

However i am not able to get why those extra POST spans are showing up.

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 08:02:54 UTC

Also FYI, the API is being run by the command: OTEL_RESOURCE_ATTRIBUTES=service.name=autofill_exports OTEL_EXPORTER_OTLP_ENDPOINT="ndpoint" opentelemetry-instrument <followed by the api command>

Photo of vishal-signoz
vishal-signoz
Thu, 17 Aug 2023 09:04:40 UTC

Any reason why you are not using auto instrumentation?

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 09:44:33 UTC

When using auto instrumentation i was not getting spans for individual methods.

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 09:44:53 UTC

Or could you point me to any correct resource?

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 09:45:23 UTC

using auto instrumentation?

Photo of Snehanshu
Snehanshu
Thu, 17 Aug 2023 09:53:04 UTC

on following this page i was getting only the endpoint span, and this was too in large number. This did not give the spans for the methods it was calling internally.

Photo of Snehanshu
Snehanshu
Sun, 20 Aug 2023 07:32:05 UTC

vishal-signoz if you could answer this?