-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Create internal/metadataproviders
module
#10376
Create internal/metadataproviders
module
#10376
Conversation
5e315a9
to
01d424b
Compare
internal/metadataclients
moduleinternal/metadataproviders
module
@Aneurysm9 @pmm-sumo @dashpole would you mind having a look at this? Although the diff is large, the changes are mostly either renames or go.mod/go.sum updates, so it shouldn't take too long to review |
I'm curious what's @bogdandrutu take on how it fits the larger vision on component relationship within the collector. One alternative approach would be be moving the detectors into an extension. It would have pros and cons but then would be easier to refer by other components (e.g. for components outside of the contrib) |
@pmm-sumo I think that is a fair question (since components that use an internal module won't be able to be moved outside of this repository for now), but I don't think we need to solve this on this PR because it's not a problem specific to this new internal module: the problem existed before and we are not making it any worse by doing this (other than having a couple more components depend on internal modules, but if we are worried about that we should ban In my mind the solution eventually would be to move this new |
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
Marking as ready to merge since we have two approvals, one from a CODEOWNER |
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.
@mx-psi please resolve the conflicts and we can merge this
@codeboten Thanks for the ping, should be ready to merge now! |
* [processor/resourcedetection] Move 'azure' metadata provider to internal package * [processor/resourcedetection] Move 'docker' metadata provider to internal package * [processor/resourcedetection] Move 'system' metadata provider to internal package * [processor/resourcedetection] Move 'gcp' metadata provider to internal package * [processor/resourcedetection] Move 'consul' metadata provider to internal package * [processor/resourcedetection] Move 'ec2' metadata provider to internal package * Add CODEOWNERS entry (same as resourcedetectionprocessor) * add new module to versions.yaml * Fix merge * make gotidy
Description:
Move the metadata providers for different environments used in the resource detection processor to a new internal module.
The goal is to reduce duplication in the usage of these metadata clients among different components (namely, we want to use some of these in the Datadog exporter).
In the future, it would also be nice to handle things like retries and caching in a common way for all components, to avoid e.g. one component being able to query the AWS EC2 endpoint while another times out; but this is out of scope on this particular PR, which tries to only make minimal changes on the code moved to the new module.
Link to tracking Issue: Relates to #1379 and #10424
Testing: Original unit tests are kept