The declarative config schema ExperimentalResourceDetection (https://opentelemetry.io/docs/specs/otel-config/types/#type-experimentalresourcedetection) supports an attributes property which can define attributes to include or exclude from resource detectors.
For example, here is a declarative config snippet that would exclude detected resource attributes host.name and any attributes matching the glob pattern process.command*
file_format: '1.1'
resource:
attributes:
- name: foo
value: bar
detection/development:
attributes:
excluded:
- "host.name"
- "process.command*"
detectors:
- service:
- host:
- process:
This might involve adding some support to the resources package to support this. Because some resource attributes can be async, we cannot synchronously run the detectors and then filter before returning a Resource to use.
The declarative config schema
ExperimentalResourceDetection(https://opentelemetry.io/docs/specs/otel-config/types/#type-experimentalresourcedetection) supports anattributesproperty which can define attributes to include or exclude from resource detectors.For example, here is a declarative config snippet that would exclude detected resource attributes
host.nameand any attributes matching the glob patternprocess.command*This might involve adding some support to the
resourcespackage to support this. Because some resource attributes can be async, we cannot synchronously run the detectors and then filter before returning aResourceto use.