DataDog / datadogpy

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

Sending an event adds tags from agent config #777

Open christopherfrieler opened 1 year ago

christopherfrieler commented 1 year ago

We have a host with the DataDog agent installed and its config present. When sending an event to DataDog with this Python library, the event gets the tags from the config file attached. In our case this leads to duplicate tags which breaks some event queries in DataDog.

I've seen that this library accesses an agent config if present to get the host name. And indeed, setting attach_host_name=False when sending the event prevents this behavior. However, I've found no hint in the documentation that there is more than the host name taken from the config file, nor could I retrace this in the code, yet.

Looks like a bug to me or at least the option attach_host_name is misleading.

To Reproduce

  1. Have a host with a datadog agent installed and tags defined in its config file.
  2. Send an event to Datadog using this library without disabling attach_host_name.
  3. The event has the tags from the agent's config file (in addition to any other tags that were specified to event, even duplicate tags)

Expected behavior Sending an event (directly via DataDogs http API) should not interfere with a DataDog agent installed on that host except in the documented way, i.e. getting the host name.

Versions datadog: 0.45.0 Python: 3.8 OS: RHEL 8

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