#support

Troubleshooting Django App Instrumentation with Signoz

TLDR tim encountered issues instrumenting a Django app with Signoz. tim resolved the problem by identifying the need for a client to forward content to Signoz.

Powered by Struct AI
🙌 1
12
5d
Solved
Join the chat
May 23, 2023 (6 days ago)
tim
Photo of md5-284d9ca30e4a8a4c2a165f5f9a812e09
tim
08:20 PM
I managed to get the node-app example working with signoz, but for some reason instrumenting my django app is beyond my ability
May 24, 2023 (5 days ago)
Vishal
Photo of md5-31f2f0cedfc4bc1be85b1ab6bf0b9040
Vishal
09:13 AM
Did you follow the Django instrumentation tutorial?
https://signoz.io/docs/instrumentation/django/
Let us know if you face any problems
tim
Photo of md5-284d9ca30e4a8a4c2a165f5f9a812e09
tim
01:40 PM
I've been following the django opentelemetry example instructions- these are also very helpful
01:41
tim
01:41 PM
Currently, it looks like my issue is that when I set up telemetry, I somehow default to the proxy tracer, which has a real_tracer as None and only contains the noop tracer
01:42
tim
01:42 PM
The entirety of my setup is stuffed into the main.py file, rather than handling env vars in another layer, so it should be easy to debug:
Image 1 for The entirety of my setup is stuffed into the main.py file, rather than handling env vars in another layer, so it should be easy to debug:
01:44
tim
01:44 PM
I successfully trigger traces on requests to django, however the code in opentelemetry/exporter/otlp/proto/http/traceexporter/_init::OTLPSpanExporter.export looks like it is never called. This is consistent with what I see in Signoz- nada
01:57
tim
01:57 PM
Tried replacing the ProxyTraceProvider with the TraceProvider, which got me a real trace provider! Now I am looking at an empty list of span processors
01:59
tim
01:59 PM
Is there a bunch of magic that was supposed to happen by the opentelemetry bootstrap process that just failed to occur in my project? It's a django project but it has plenty of frontend code, I could see an automatic system getting confused and assuming this is a node project
02:10
tim
02:10 PM
The instructions I've been following are here, which explains a lot: https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples/django

It looks like this is an example of setting up django for a proxy trace setup, which means to exporters and the proxy tracer, and without a client to do the forwarding nothing happens
02:11
tim
02:11 PM
So if I want to use the django instrumentor, I need to have my own client to forward content to signoz
02:12
tim
02:12 PM
Classic mistake of drifting away from signoz documentation (as the tutorial you posted has key issues for my use case) into the tutorials of a dependency library, which is agnostic to the endpoint being used.
09:26
tim
09:26 PM
It lives!
🙌 1