We are currently running a Django Application as one of our services in Qovery and we are not able to have the datadog python tracer connect to the datadog agent installed on the node. The issue we get is
Exception in thread ddtrace.internal.writer:AgentWriter:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/site-packages/ddtrace/internal/periodic.py", line 59, in run
self._on_shutdown()
File "/usr/local/lib/python3.7/site-packages/ddtrace/internal/writer.py", line 444, in periodic
self.flush_queue(raise_exc=False)
File "/usr/local/lib/python3.7/site-packages/ddtrace/internal/writer.py", line 420, in flush_queue
self._send_payload(encoded, len(enc_traces))
File "/usr/local/lib/python3.7/site-packages/ddtrace/internal/writer.py", line 318, in _send_payload
response = self._put(payload, headers)
File "/usr/local/lib/python3.7/site-packages/ddtrace/internal/writer.py", line 290, in _put
conn = get_connection(self.agent_url, self._timeout)
File "/usr/local/lib/python3.7/site-packages/ddtrace/internal/agent.py", line 81, in get_connection
return compat.httplib.HTTPConnection(hostname, parsed.port, timeout=timeout)
File "/usr/local/lib/python3.7/urllib/parse.py", line 172, in port
port = int(port, 10)
ValueError: invalid literal for int() with base 10: 'None'
Not exactly sure whats going on here. For our setup with our normal infrastructure (Kubes Non Qovery) we normally have an ENV VAR for DD_AGENT_HOST and that points to the host for our Node in our K8 cluster. I think maybe Qovery may have a different setup but not 100% sure on this one. We could potentially be missing a specific env var that helps the application send traces to the DD Agent on the Kube Node for our Qovery Cluster
HOW TO REPRODUCE
We followed the exact steps on Qovery’s documentation on installing the Datadog agent on the cluster. And once we started sending traces we got the error above.
We actually removed the Datadog Agent from our cluster when we realized it wasn’t working again. Would you like me to reinstall it for the purpose of this troubleshooting.
Okay @Parth_Patel
You can try to reinstall it, from the error message above I think the port wasn’t available in your application: ValueError: invalid literal for int() with base 10: 'None'
Do you remember if you set an environment variable on Qovery side to indicate the datadog port ?
I’m digging deeply into the docs and going to test on my side the installation & connection with a service to be sure for the good datadog configuration.
Yes I’ve setup a simple app on my side to validate the configuration, the logs are well sent to datadog.
As I’m not familiar with python, I created a simple java based and followed the instruction available in the datadog interface for APM > Introduction (it works in a similar way for python with an agent to download and specify at start):
Then by creating a simple application in Qovery, the logs are available in datadog. Didn’t create any variable on Qovery side at this point. The HOST corresponds well to the node name where the pods of my application are running:
From my tests, the configuration specified in the qovery datadog documentation seems sufficient to let your applications send the logs to datadog, the DD_AGENT_HOST doesn’t seem to be mandatory.