DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
611 stars 302 forks source link

statsd logging does not work in UvicornWorker and does not throw any error #846

Open tim-gb opened 1 month ago

tim-gb commented 1 month ago

Describe the bug In my application, I deploy a FastAPI app to my kubernetes pod, and I have a datadog agent set up in the cluster. When I exec into my pod and start a REPL, I can do statsd.set no problem, and find my metric on datadog metric explorer. My app has the following structure:

When I run statsd.set("example_metric", 1) in start.py, I can see metrics successfully logged. When I run statsd.set("example_metric", 1) in main.py, I don't see my metric showing up, and there are no errors.

Label the issue properly.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior Metrics should show up on metrics explorer, or stastd should throw error when it fails.

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

Environment and Versions (please complete the following information): A clear and precise description of your setup:

datadog==0.49.0 fastapi==0.111.1 uvicorn==0.30.3 gunicorn==20.1.0

Additional context I tried comparing all my environment variables by dumping them in start.py and in main.py, and they are the same.

github-actions[bot] commented 1 week 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.