-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[resourcedetectionprocessor] Azure detector #2372
[resourcedetectionprocessor] Azure detector #2372
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2372 +/- ##
==========================================
- Coverage 91.20% 91.18% -0.02%
==========================================
Files 417 419 +2
Lines 20935 20981 +46
==========================================
+ Hits 19093 19132 +39
- Misses 1379 1382 +3
- Partials 463 467 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
} | ||
|
||
// computeMetadata is the Azure IMDS compute metadata response format | ||
type computeMetadata struct { |
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.
The struct does not contain every field returned by Azure, the rest of the fields are ignored since we use the default JSON decoder.
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.
Sorry for the delay - lgtm
@mx-psi can you take ownership of Azure detector? If yes please add yourself as codeowner for processor/resourcedetectionprocessor/internal/azure directory. |
This reverts commit c51ef5f. It's easier to fix the merge conflict if I revert my commit first.
processor/k8sprocessor/ @open-telemetry/collector-contrib-approvers @owais @dmitryax @pmm-sumo | ||
processor/metricstransformprocessor/ @open-telemetry/collector-contrib-approvers @james-bebbington | ||
processor/resourcedetectionprocessor/ @open-telemetry/collector-contrib-approvers @jrcamp @pmm-sumo @anuraaga @dashpole | ||
processor/resourcedetectionprocessor/internal/azure @open-telemetry/collector-contrib-approvers @mx-psi |
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.
Added myself to CODEOWNERS here (I would recommend looking at the diff hiding whitespace changes)
@tigrannajaryan I am happy to do so, I added myself to the CODEOWNERS file :) I am not sure if I will be pinged for reviews though since I don't have write access to the repository and that is a requirement according to Github docs. I will do my best to check PRs/issues manually in any case. |
I am not sure either, but it is good to at least have you listed in the file so that we know who to ask questions. :-) Thank you. |
@jrcamp do you plan to review or good to merge? |
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.
LGTM, just one question about the azure.* attributes.
attrs.InsertString(conventions.AttributeCloudRegion, compute.Location) | ||
attrs.InsertString(conventions.AttributeHostID, compute.VMID) | ||
attrs.InsertString(conventions.AttributeCloudAccount, compute.SubscriptionID) | ||
attrs.InsertString("azure.vm.size", compute.VMSize) |
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.
@tigrannajaryan thoughts on these? Do we have any policy about using things that aren't in semantic conventions?
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, we do. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/attribute-and-label-naming.md#recommendations-for-opentelemetry-authors and https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/attribute-and-label-naming.md#recommendations-for-application-developers
This seems applicable:
The name may be generally applicable to applications in the industry. In that case consider submitting a proposal to this specification to add a new name to the semantic conventions, and if necessary also to add a new namespace.
Or perhaps this:
The name is specific to your company and may be possibly used outside the company as well. To avoid clashes with names introduced by other companies (in a distributed system that uses applications from multiple vendors) it is recommended to prefix the new name by your company's reverse domain name, e.g. com.acme.shopname
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.
Note that the Amazon ECS detector also uses attribute names that are not in the semantic conventions and they prefix them by aws.ecs
.
I think the resource group one is fairly specific to how Azure works and has no equivalents on other cloud providers so it should have some Azure prefix (if azure
is not okay, which one should be used?) . I thought about using host.type
instead of azure.vm.size
but it feels like a stretch.
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.
You can keep it for now, but think about Azure attribute name conventions and if you can please make a proposal in spec repo.
Please resolve merge conflicts. |
@tigrannajaryan Done |
@tigrannajaryan Could this be merged? |
…#2372) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.6.1 to 1.7.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](stretchr/testify@v1.6.1...v1.7.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Create Azure resource detector for gathering metadata from the [Azure IMDS](https://aka.ms/azureimds). Due to Azure/azure-sdk-for-go#982 we have to query the endpoint manually. **Link to tracking Issue:** Fixes #2326 **Testing:** Added unit tests. Tested end to end with provided sample configuration on an Azure VM.
Description:
Create Azure resource detector for gathering metadata from the Azure IMDS.
Due to Azure/azure-sdk-for-go#982 we have to query the endpoint manually.
Link to tracking Issue: Fixes #2326
Testing: Added unit tests. Tested end to end with provided sample configuration on an Azure VM.
Documentation: Documented detector on README