opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

How to easily get resource attributes in instrumentation

Open CoderPoet opened this issue 3 years ago • 3 comments

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: image

Describe alternatives you've considered Are there any breaking changes to the opentelemetry api

CoderPoet avatar Aug 20 '22 14:08 CoderPoet

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.

jkwatson avatar Aug 20 '22 18:08 jkwatson

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.

CoderPoet avatar Aug 21 '22 05:08 CoderPoet

Mainly to solve the problem: https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/6495

CoderPoet avatar Aug 21 '22 06:08 CoderPoet