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

Ignore empty label_to_hostname label value #7232

Merged
merged 1 commit into from
Jul 29, 2020

Conversation

ahmed-mez
Copy link
Contributor

@ahmed-mez ahmed-mez commented Jul 29, 2020

What does this PR do?

  • Do not add a host tag when hostname is None and the label_to_hostname label's value is ""

Motivation

  • Avoid having incomplete and incorrect host tags with label_to_hostname_suffix only (host:-<cluster-name> in case of KSM)
  • When hostname is None and the label_to_hostname label's value is "" we shouldn't add a host tag

Additional Notes

Could be QAed using KSM and the metric kube_pod_status_unschedulable

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov
Copy link

codecov bot commented Jul 29, 2020

Codecov Report

Merging #7232 into master will increase coverage by 4.22%.
The diff coverage is n/a.

Impacted Files Coverage Δ
disk/tests/common.py 64.28% <0.00%> (-35.72%) ⬇️
disk/tests/conftest.py 85.71% <0.00%> (-11.43%) ⬇️
disk/datadog_checks/disk/disk.py 83.66% <0.00%> (-3.59%) ⬇️
disk/tests/test_filter.py 96.45% <0.00%> (-3.55%) ⬇️
dns_check/datadog_checks/dns_check/dns_check.py 86.45% <0.00%> (-2.09%) ⬇️
twemproxy/tests/test_twemproxy.py
ibm_db2/tests/test_integration.py
rethinkdb/datadog_checks/rethinkdb/types.py
http_check/datadog_checks/http_check/adapters.py
ssh_check/datadog_checks/ssh_check/__about__.py
... and 713 more

@ahmed-mez ahmed-mez merged commit 25d78ba into master Jul 29, 2020
@ahmed-mez ahmed-mez deleted the ahmed-mez/consider-empty-label-to-hostname-config branch July 29, 2020 12:38
@therc
Copy link
Contributor

therc commented Jun 10, 2021

Sorry to post on a PR that's almost one year old, but this is where there's the most context. What are the expectations if an agent sends a metric without any host tags at all? I'm asking because I found some odd kubernetes_state metrics from the first attempt to run a datadog-agent on a brand new node (it failed the health check within a few minutes and it worked fine after a restart). In those metrics, the host was set to an EC2 instance ID that I can't find anywhere in EKS, Datadog or ASG logs. No other metric or integration seems to have used it (metrics summary is not too helful here, maybe because there seems to be data for just those four minutes). I was wondering if perhaps this might have been set on the server side, hence my question.

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

Successfully merging this pull request may close these issues.

5 participants