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

[exporter/datadog] Add Kubernetes hostname provider #10911

Merged

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Jun 13, 2022

Description:

  • Add Kubernetes hostname provider for the preview hostname logic.
  • Fixes some issues on the chain hostname provider (will add more tests on a future PR)

Link to tracking Issue: #10424

Testing: Added unit tests. TBD: end to end tests

@mx-psi mx-psi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jun 13, 2022
@mx-psi mx-psi force-pushed the mx-psi/datadog/kubernetes-hostname branch from 6743844 to 19fe8ab Compare June 13, 2022 11:34
@mx-psi mx-psi marked this pull request as ready for review June 13, 2022 11:36
@mx-psi mx-psi requested review from a team and dmitryax June 13, 2022 11:36
Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use resource detectors, and then reference resource attributes in this exporter? It seems like this is reimplementing most resource detection code.

@mx-psi
Copy link
Member Author

mx-psi commented Jun 13, 2022

Why not use resource detectors, and then reference resource attributes in this exporter? It seems like this is reimplementing most resource detection code.

@dashpole That's a fair question. We have tried to rely as much as possible on the resource detection processor/k8sattributes processor so far (e.g. our current implementation requires you to use the k8sattributes processor if on Kubernetes for certain environments), but with this approach it's not possible to support some setups without passing significant complexity to users. Our exporter needs to send a payload with information about the 'host' in which it is running, but when information like k8s.node.name comes in a metrics/traces/logs payload, it's not possible to know if it comes from the host in which the Collector is running or from a remote host.

That said, I am trying to not duplicate code (see #10376) and will do future refactors to reduce code duplication more, so that in that sense the duplication is reduced as much as possible.

@mx-psi mx-psi requested a review from dashpole June 14, 2022 15:41
@mx-psi mx-psi added the ready to merge Code review completed; ready to merge by maintainers label Jun 16, 2022
We can't make it fail at provider build time, since otherwise it will make the whole provider
build fail if we are not on Kubernetes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Code review completed; ready to merge by maintainers Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants