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

[datadogexporter] Support resource conventions for hostnames #1434

Merged

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Oct 30, 2020

Description:

The resource attributes of metrics and traces are now checked to see if there are any of host.id, host.name or container.id to get a suitable hostname (see resource semantic conventions here). This hostname has preference over the one retrieved automatically. This allows

  • using the exporter in an agent-collector setup, where each agent sets the correct attributes for later processing
  • being compatible with other Collector components that set these attributes, like the resource detection processor.

Link to tracking Issue: n/a
Testing: Added unit tests. Tested in an end to end environment
Documentation: Stated support for semantic conventions on the README. Documented public functions.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #1434 into master will increase coverage by 1.28%.
The diff coverage is 48.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1434      +/-   ##
==========================================
+ Coverage   87.43%   88.71%   +1.28%     
==========================================
  Files         340      341       +1     
  Lines       16602    16702     +100     
==========================================
+ Hits        14516    14818     +302     
+ Misses       1631     1414     -217     
- Partials      455      470      +15     
Flag Coverage Δ
integration 70.87% <ø> (?)
unit 87.35% <48.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
exporter/datadogexporter/metrics_translator.go 62.22% <0.00%> (-2.90%) ⬇️
exporter/datadogexporter/metadata/ec2/ec2.go 30.00% <50.00%> (+5.00%) ⬆️
exporter/datadogexporter/metadata/host.go 62.96% <60.00%> (-1.75%) ⬇️
exporter/datadogexporter/translate_traces.go 81.21% <60.00%> (-0.65%) ⬇️
...eiver/awsxrayreceiver/internal/udppoller/poller.go 97.61% <0.00%> (-2.39%) ⬇️
receiver/k8sclusterreceiver/watcher.go 95.29% <0.00%> (-2.36%) ⬇️
internal/common/testing/container/container.go 73.68% <0.00%> (ø)
receiver/jmxreceiver/receiver.go 94.73% <0.00%> (+10.52%) ⬆️
receiver/dockerstatsreceiver/docker.go 92.30% <0.00%> (+39.05%) ⬆️
receiver/dockerstatsreceiver/receiver.go 96.82% <0.00%> (+49.20%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d54c5d5...44024db. Read the comment docs.

@mx-psi mx-psi marked this pull request as ready for review October 30, 2020 17:09
@mx-psi mx-psi requested a review from a team as a code owner October 30, 2020 17:09
@mx-psi
Copy link
Member Author

mx-psi commented Oct 30, 2020

cc @KSerrania and @ericmustin (for the traces code) to review

Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

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

👍 lgtm from tracing perspective.

one note, when this is merged we should make sure to document host name ordering somewhere users can find, either within dd docs or in our readme

@bogdandrutu bogdandrutu merged commit 65a4033 into open-telemetry:master Nov 1, 2020
@mx-psi mx-psi deleted the mx-psi/handle-conventions branch November 9, 2020 09:34
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
* Add a Config/Option for histogram

* Just one option here

* Test fixes

* Support and test int64 histograms

* Changelog

* Lint

* Un-export three things.
codeboten pushed a commit that referenced this pull request Nov 23, 2022
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

Successfully merging this pull request may close these issues.

3 participants