Skip to content

[sdk-node, resources] support resource.detection/development.attributes from declarative config #6986

Description

@trentm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions