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

Documentation how to use collect_ec2_tags and exclude_ec2_tags #1396

Open
brandocomando opened this issue May 14, 2024 · 3 comments
Open

Documentation how to use collect_ec2_tags and exclude_ec2_tags #1396

brandocomando opened this issue May 14, 2024 · 3 comments

Comments

@brandocomando
Copy link

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
Copy link

taer commented May 20, 2024

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
Copy link

taer commented May 21, 2024

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. :)

@deadok22
Copy link

I reached out to customer support with this very question earlier this year. The tags come from the AWS integration. The ec2 instance tags get added to host metadata for matching host names.

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

3 participants