-
Notifications
You must be signed in to change notification settings - Fork 130
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 resource providers for common cloud providers #1074
Comments
Hi @SylvainJuge, thanks for starting the initiative to gather implementations for all cloud providers. Once all the resource detectors are added to the contrib repository, what will be the recommended way for users of the Java agent to incorporate these detectors? Naively, I would expect the workflow to look like:
This seems pretty inconvenient, especially because they require the use of advanced features of Maven/Gradle to automate. I know that there have been earlier discussions about incorporating detectors for common cloud platforms into the default agent distribution. In at least one case, we decided to exclude the detector because it added startup latency. I was wondering if we could get the best of both worlds by
This would parallel the approach used in the Collector, where the contrib distribution includes many detectors, but a given detector is only invoked if it's explicitly enabled in the Collector configuration file. |
Hi @punya , sorry for the late reply on this. So far I haven't really thought about "making it convenient to use them", but that's a very good point here. Having them included and disabled by default in the agent would definitely be a good option:
In order to implement the "included but disabled by default", what we did on our side so far is the following:
This strategy is complex and can´t be reused when using those resource providers directly as SDK extensions. On the code side, I think that keeping it in the contrib repo and not directly into the agent allows to reuse them as SDK extensions without an agent, but in practice I really don't know how popular or how relevant this option would be. Given support for java agents in native images like GraalVM is clearly not for the short term that's still something to keep in mind. So here I would be in favor of keeping the code in contrib repo and add them (but disabled) in the agent. However I am not 100% clear about is what would be the best option to implement the "included but disabled by default" behavior:
I think that we might need to have an agent-only configuration option here to implement the opt-in behavior, as we can't alter the semantics of the existing SDK autoconfig options, for example |
this makes sense to me
even if we moved them to the instrumentation repo, we would still publish them as standalone artifacts, e.g. https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/resources/library but I agree with keeping them here in the contrib repo where the cloud vendors can have ownership of them, and we can still pull them into the Java agent. |
I think this is a good idea 😄
|
What I meant here is that we should the same values as the ones we can use with the I wasn't aware of the "short names" that we can use with other providers, is there any documentation or list of them somewhere ? Currently the SDK documentation only refers to FQN. |
Sorry, confused that with exporter... |
@trask what about |
something similar to |
I was wondering if this makes sense given that resource providers can also be used without the otel java agent. Would a user using the resource providers as library instrumentation expect to have the notion of default enabled providers? I think the answer is no. Users have to manually add a dependency on the resource provider, and it makes sense to interpret this as wanting to enable that resource provider by default. In contrast, when the agent is installed, (most) users don't have a say on which resource providers are included, so it makes sense to have an additional configuration knob. If something like
|
In the case of a spring boot starter it would also make sense - but I think it doesn't change the proposed solution. If I understand the proposal correctly, it could be implemented with a new NamedResourceProvider:
Suggestions
|
@trask @jack-berg I've created a PR that implements this proposal: open-telemetry/opentelemetry-java#6250 |
Most cloud providers provide a metadata endpoint that allows to build resource information,
however in Java contrib repo we only have an implementation for AWS.
For example, in the js contrib repo, we can see there are other implementations in https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node : alibaba, gcp and aws (I haven't looked at their respective implementations though).
The goal here is to add implementations for the most common cloud providers.
Initially the focus will be on the following cloud providers: AWS, GCP and Azure with the following task breakdown
Other cloud providers can of course be added later, but should be tracked independently.
Collector implementations that can be used for reference : https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor
for triage: This issue can be assigned to me.
The text was updated successfully, but these errors were encountered: