Open joaopgrassi opened 6 months ago
For Go it is Detector.Detect
: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource#Detector
A PR to clarify this would be welcome!
For java its ResourceProvider. Detectors that implement this interface are able to contribute to the resource generated by opentelemetry-sdk-extension-autoconfigure
, which is java's tool for automatically configuring the SDK based on environment.
What are you trying to achieve?
We have specified the way to load resource attributes from the environment via resource detector packages.
The Resource SDK spec says:
But it never defined exactly what the method is called. This may end up in a situation where each library exposes a method with a different name which then creates problems if such packages are to be loaded/invoked automatically (e.g., by an agent). This would make implementing something like #2948 impossible.
What did you expect to see?
Clear specification of what a resource detector package must provide, giving which method it must have, similar to what we do for Samplers for example.