-
Notifications
You must be signed in to change notification settings - Fork 492
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.3% 63.4%
=====================================
Files 194 195 +1
Lines 12042 12097 +55
=====================================
+ Hits 7633 7676 +43
- Misses 4192 4204 +12
Partials 217 217
|
@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. |
|
||
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.
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