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

Add AKS resource detector #3035

Merged
merged 2 commits into from
Apr 12, 2021
Merged

Add AKS resource detector #3035

merged 2 commits into from
Apr 12, 2021

Conversation

pmcollins
Copy link
Member

This change creates a resource detector for AKS. It checks for the presence of an env variable to determine if it's running on k8s, and attempts to retrieve data from the Azure IMDS endpoint to determine if it's running on Azure. If both conditions are met, it sets two Resource attributes. If not, no error is returned from the detector. Additionally, a change was made to the Azure detector to also not return an error when the IMDS endpoint is not available.

Behavior tested on AKS, Azure VM, and Docker Desktop k8s.

@codecov
Copy link

codecov bot commented Apr 9, 2021

Codecov Report

Merging #3035 (df5bc82) into main (f1ee616) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3035      +/-   ##
==========================================
- Coverage   91.56%   91.55%   -0.01%     
==========================================
  Files         466      468       +2     
  Lines       22998    23022      +24     
==========================================
+ Hits        21057    21078      +21     
- Misses       1445     1447       +2     
- Partials      496      497       +1     
Flag Coverage Δ
integration 68.96% <ø> (-0.07%) ⬇️
unit 90.53% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
processor/resourcedetectionprocessor/factory.go 98.70% <100.00%> (+0.01%) ⬆️
...sourcedetectionprocessor/internal/azure/aks/aks.go 100.00% <100.00%> (ø)
...resourcedetectionprocessor/internal/azure/azure.go 100.00% <100.00%> (ø)
...ourcedetectionprocessor/internal/azure/metadata.go 77.41% <100.00%> (ø)
...edetectionprocessor/internal/azure/mockprovider.go 100.00% <100.00%> (ø)
internal/stanza/receiver.go 94.11% <0.00%> (-5.89%) ⬇️

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 f1ee616...df5bc82. Read the comment docs.

Behavior tested on AKS, Azure VM, and Docker Desktop k8s.
@pmcollins pmcollins marked this pull request as ready for review April 12, 2021 15:57
@pmcollins pmcollins requested a review from a team April 12, 2021 15:57
Copy link
Contributor

@jrcamp jrcamp left a comment

Choose a reason for hiding this comment

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

looks good, just a couple nits. thanks!

@pmcollins
Copy link
Member Author

Loadtest failed :-|

@bogdandrutu bogdandrutu merged commit cac7bc6 into open-telemetry:main Apr 12, 2021
pmatyjasek-sumo pushed a commit to pmatyjasek-sumo/opentelemetry-collector-contrib that referenced this pull request Apr 28, 2021
* Add AKS resource detector

Behavior tested on AKS, Azure VM, and Docker Desktop k8s.

* Address PR feedback
alexperez52 referenced this pull request in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
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.

4 participants