DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
614 stars 306 forks source link

Unable to send metrics inside docker container #860

Open viperfx opened 1 month ago

viperfx commented 1 month ago

Describe the bug Unable to send metrics inside docker container.

To Reproduce Steps to reproduce the behavior:

  1. Start a python shell in docker container
  2. Run the code snippet below
  3. Check datadog if the metric is sent.
from datadog import statsd
from datadog import initialize
initialize(statsd_host="localhost",statsd_port=8125)
statsd.increment("my_metric")

Expected behavior Metric should send as expected.

Run the above steps, but in a local python shell, outside of a docker container. It works as expected.

Screenshots If applicable, add screenshots to help explain your problem.

Environment and Versions (please complete the following information):

Additional context Add any other context about the problem here.

github-actions[bot] commented 6 days ago

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

carlosroman commented 5 hours ago

Has your container got access to the Agent? If not then you need to make sure the container has access to where the Agent is running.