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 a resource detector for Azure VMs #5422

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

pyohannes
Copy link

Fixes #5421

This PR adds a resource detector for Azure VMs which sets values according to to semantic conventions for host, cloud, and os resources:

  • cloud.provider
  • cloud.platform
  • host.id
  • host.name
  • host.type
  • os.type
  • os.version

@pyohannes pyohannes requested a review from a team as a code owner April 23, 2024 12:29
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 78.18182% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 63.4%. Comparing base (1c0eae0) to head (1967dbb).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5422   +/-   ##
=====================================
  Coverage   63.3%   63.4%           
=====================================
  Files        194     195    +1     
  Lines      12042   12097   +55     
=====================================
+ Hits        7633    7676   +43     
- Misses      4192    4204   +12     
  Partials     217     217           
Files Coverage Δ
detectors/azure/vm/vm.go 78.1% <78.1%> (ø)

@MrAlias
Copy link
Contributor

MrAlias commented May 23, 2024

@pyohannes we will want to add you as an owner for this.

@MrAlias
Copy link
Contributor

MrAlias commented May 23, 2024

@pyohannes we will want to add you as an owner for this.

@pyohannes please go ahead and add this module here with yourself and the go-approvers as the code owners.

@pyohannes
Copy link
Author

@pyohannes please go ahead and add this module here with yourself and the go-approvers as the code owners.

@MrAlias Done, I added myself as a code owner.

CHANGELOG.md Outdated Show resolved Hide resolved

type azureInstanceMetadataClient struct{}

func (c *azureInstanceMetadataClient) GetJSONMetadata() ([]byte, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Since this method is mocked in the Detect test, could we test it anyway? (if we move the IP/port for the metadata endpoint into private variables, we can change them to an httptest endpoint in tests).

Copy link
Author

Choose a reason for hiding this comment

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

Yes, if so desired we can do that. We don't need to mock the method then, but just make the endpoint configurable.

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.

Add a resource detector for Azure VMs
4 participants