-
Notifications
You must be signed in to change notification settings - Fork 498
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5422 +/- ##
=======================================
+ Coverage 63.6% 63.7% +0.1%
=======================================
Files 194 195 +1
Lines 12092 12126 +34
=======================================
+ Hits 7699 7736 +37
+ Misses 4174 4172 -2
+ Partials 219 218 -1
|
@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. |
063b9b6
to
0ae7f4a
Compare
@MrAlias Done, I added myself as a code owner. |
detectors/azure/vm/vm.go
Outdated
|
||
type azureInstanceMetadataClient struct{} | ||
|
||
func (c *azureInstanceMetadataClient) GetJSONMetadata() ([]byte, error) { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1967dbb
to
0fabd24
Compare
ef19296
to
d4e48d3
Compare
Co-authored-by: David Ashpole <dashpole@google.com>
Co-authored-by: David Ashpole <dashpole@google.com>
fdae103
to
507cdf6
Compare
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
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