opentelemetry-java
opentelemetry-java copied to clipboard
How to easily get resource attributes in instrumentation
Is your feature request related to a problem? Please describe. I hope that the resource attribute can be easily obtained in the instrumentation
Describe the solution you'd like
Maybe we can add a method to obtain resource attributes for opentelemetry, like this:

Describe alternatives you've considered Are there any breaking changes to the opentelemetry api
Since the Resource isn't a feature of the OpenTelemetry APIs (just of the SDK), I think this is not something we will do. If you want to have the Resource become a part of the API surface, that would absolutely have to go through the specification process.
Since the Resource isn't a feature of the OpenTelemetry APIs (just of the SDK), I think this is not something we will do. If you want to have the Resource become a part of the API surface, that would absolutely have to go through the specification process.
Thanks for the reply, it will indeed have a strong impact on the APIs specification, I will try other ways to solve this kind of problem.
Mainly to solve the problem: https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/6495