ddtrace-graphql
ddtrace-graphql copied to clipboard
Not picking up DD_VERSION environment variable
Hello, thanks for making this library, it's super helpful.
I'm using version 0.2.0
, and I have a problem that the graphql APM service is not picking up DD_VERSION
environment variable.
Any help will be really appreciated, thank you.
Hi @arsalasif !
Can you check what version of ddtrace
are you using? Reading their docs ~ https://github.com/DataDog/dd-trace-py/blob/16487e51380e28672337a54a9921a73fc44adf07/docs/configuration.rst#configuration ~ DD_VERSION
was added in v0.36.0
.
Hi @beezz ! Thanks for such a quick response. I am using 0.43.0
version of dd-trace. So celery and celery-beat are able to get the version and I can see that in analytics too. But somehow it's not picking up for graphql
service. Interestingly, I can see the same behavior for uvicorn
service as well. Any ideas about why?
Hi @beezz. Any update on this? Thank you!
Hi @arsalasif! No update so far. I briefly looked into it but did not see anything obvious. Hopefully, I'll have time to take another look at the weekend.
Hi @arsalasif !
I was able to track it down to this piece of code:
- https://github.com/DataDog/dd-trace-py/blob/491c3d536fcc40e494118ceba0aa00d5c66c298a/ddtrace/tracer.py#L489-L499
Only set the version tag on internal spans.
I was able to get the version tag working by setting the environment variable DD_SERVICE
to match the graphql
service. By default it's graphql
e.g.:
DD_SERVICE=graphql DD_VERSION=1.2.3 python app.py
If you changed the service name using the DDTRACE_GRAPHQL_SERVICE
environment variable you need to set both e.g.:
DDTRACE_GRAPHQL_SERVICE=foo DD_SERVICE=foo DD_VERSION=1.2.3 python app.py
Please let me know if that works for you!
Hi @beezz. I tried both approaches, one where I assigned the DDTRACE_GRAPHQL_SERVICE=web
to make it same as my DD_SERVICE
and container name. Another where I set DD_SERVICE=graphql
. Neither approach worked unfortunately. I have no idea what's wrong here. I tried with multiple deployments and all combinations. Thank you for helping me with this!