Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append tags to datadog.yaml instead of overwriting it with a new file. #434

Open
tostroski opened this issue Apr 19, 2022 · 3 comments
Open

Comments

@tostroski
Copy link

I am trying to simplify our datadog rollout with ansible. I am running into an issue where I need multiple data_dog checks on the same host and when the second integration gets installed, it wipes out my main agent datadog.yaml file.

Here is the stripped down example of my playbook:

- name: Deploy Datanode Integration
  hosts: node
  roles:
    - { role: datadog.datadog }
  vars:
    datadog_api_key: "{{ dd_api_key }}"
    datadog_agent_version: "{{ dd_agent_version }}"
    datadog_config:
      tags:
        - service:hdfs_datanode
      logs_enabled: false  # available with Agent v6 and v7
    datadog_checks:
      hdfs_datanode:
        init_config:
        instances:
          - hdfs_datanode_jmx_uri: http://{{ inventory_hostname }}:{{ port }}

- name: Deploy Kafka Integration
  hosts: kafka
  roles:
    - { role: datadog.datadog }
  vars:
    datadog_api_key: "{{ dd_api_key }}"
    datadog_agent_version: "{{ dd_agent_version }}"
    datadog_config:
      tags:
        - service:kafka
      logs_enabled: false  # available with Agent v6 and v7
    datadog_checks:
      kafka:
        init_config:
            is_jmx: true
            collect_default_metrics: true
            new_gc_metrics: true
        instances:
          - host: "{{ inventory_hostname }}"
            port: {{ port }}

The issue is that if a host belongs to both the node group and the kafka group, the node groups tags get wiped out when the kafka group runs.

Is there a way to append the tags in the datadog.yaml file or is there a better way to do this?

Thanks!

@bkabrda
Copy link
Contributor

bkabrda commented Apr 19, 2022

Hi 👋 I think you're basically hitting a variation of #366, which as noted in comment #366 (comment) is more of an Ansible issue rather than issue with the DD role. The referenced issue contains some suggested workarounds that you might be able to use - can you take a look and see if anything there might be helpful?

@tostroski
Copy link
Author

Thanks for the fast reply! I agree, they are vary similar. I did review #366 before opening this issue, i was not sure how well it would scale into a larger production environment. I will dig into it a bit more.

@bkabrda
Copy link
Contributor

bkabrda commented Apr 19, 2022

Sounds good. I'll also keep this in mind and let you know if I figure out a better way to do these things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants