Closed tsoos99dev closed 5 hours ago
Hey @tsoos99dev,
The ddtrace
library injects the active span data (span_id, trace_id, env, service, etc.) into your logs but it does not submit logs to Datadog.
To send your logs to Datadog you will need to enable and configure log collection on your Datadog Agent. For more detailed steps you can refer to this page: https://docs.datadoghq.com/getting_started/logs/.
Feel free to reopen this issue if you experience correlating traces and logs.
Hi. I'd like to send logs to the web portal, but not matter what I try I'm only getting traces to show.
Here's the example code I'm running:
I'm running it like this:
DD_SERVICE="webapp" DD_ENV="dev" DD_VERSION="1.0.0" DD_LOGS_INJECTION=true ddtrace-run python main.py
On the console output I get the following:
2024-10-22 22:30:15,162 INFO [__main__] [standalone.py:14] [dd.service=webapp dd.env=dev dd.version=1.0.0 dd.trace_id=67180b570000000015d3de3d2700c4d1 dd.span_id=8815720975494057739] - Hello World
I have the agent configured with
logs_enabled: true
. Otherwise it's a fresh install on my macbook. Should ddtrace-run handle passing on the logs to the agent based on my setup? It passes on the traces just fine. What could be going wrong?