Refactor resource detection to allow config of named resource detectors#188
Conversation
| os: | ||
| - # Enable the process resource detector. | ||
| # Note, the key "process" is an example and detector names may vary by SDK language ecosystem. | ||
| process: |
There was a problem hiding this comment.
The lack of a well known list of standard resource detector names is the biggest problem with this design. I'd like to fix that by adding such a list to the resource specification, along with general guidance that resource detectors be named according to the root namespace of attributes they typically provide. For example, a resource detector that provides os.* attributes should be named os, one that provides process.* should be named process, etc.
There was a problem hiding this comment.
For example, a resource detector that provides
os.*attributes should be namedos
I would turn it differently:
A resource detector named os should provide os.* attributes.
This is expected because the name, os, is an attributes root namespace.
It should be also possible to have a resource detector named os_simulated, qa, or my_fake_detector, that also provides os.* attributes.
Resolves #119.
Resource detection is currently naive:
This PR refactors resource detection to add more expressiveness and better accommodate a wide range of use cases.
Let's take a look at an example config after this refactor:
Most users will want to set a static set of resource attributes, especially
service.*, but resource detection is an important part of the otel ecosystem. You opt into resource detection by settingresource.detection/developmentand configuring to suit..detectorsis an array of objects, each with a single key referring to the name of a detector, and an object value passed to that detector to optionally configure it. This aligns resource detectors which the design of other SDK extension components.The ability to include / exclude attributes provided by the collection of all resource detectors is still available.