DataDog / helm-charts

Helm charts for Datadog products
Apache License 2.0
326 stars 1.01k forks source link

Documentation how to use collect_ec2_tags and exclude_ec2_tags #1396

Open brandocomando opened 1 month ago

brandocomando commented 1 month ago

After installing datadog on my EKS cluster via helm all of my metrics are inheriting the tags from my ec2 instances. I'd like to disable this, but cannot find an option to do so in the helm chart

taer commented 1 month ago

Same. The default is that it is not enabled.

root@datadog-agent-zkmx6:/# agent config | grep ec2
collect_ec2_tags: false
collect_ec2_tags_use_imds: false
ec2_metadata_timeout: 300
ec2_metadata_token_lifetime: 21600
ec2_prefer_imdsv2: true
ec2_prioritize_instance_id_as_hostname: false
ec2_use_dmi: true
ec2_use_windows_prefix_detection: false
ecs_collect_resource_tags_ec2: false
exclude_ec2_tags: []

I am using the datadog operator, and my config has this.

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
  namespace: datadog
spec:
  features:
    prometheusScrape:
      enabled: true
      enableServiceEndpoints: false
      additionalConfigs: |-
        - configurations:
          - histogram_buckets_as_distributions: true
            timeout: 10
          - exclude_ec2_tags: ["Name"]

the exclude_ec2_tags didn't seem to take, and I have all the ec2 tags. .I just swapped from BottleRocket to AL2023, and I think that is when they all appeared

taer commented 1 month ago

Version is

agent_version: 7.49.1
    install_method_installer_version: v1.3.0
    install_method_tool_version: datadog-operator

also just upgraded to 1.7.0 operator

agent_version: 7.53.0
  install_method_installer_version: v1.6.0
  install_method_tool_version: datadog-operator

Attempted this

spec:
  #https://github.com/DataDog/datadog-operator/blob/main/docs/configuration.v2alpha1.md
  override:
    nodeAgent:
      env:
        - name: DD_EC2_PREFER_IMDSV2
          value: "true"
        - name: DD_EXCLUDE_EC2_TAGS
          value: "name"

And the agent shows it now. in the config. But it doesn't matter. the agent's config shows collect_ec2_tags: false, but I'm getting the EC2 tags still in my datadog scraped prometheus metrics.

This might be a different repo's issue. But hopped on board here because I'm having very similar issues. :)