Skip to content

opentelemetry-configuration: declarative configuration does not work with slash in the field name #5395

Description

@emdneto

Describe your environment

OS: Ubuntu
Python version: 3.14
SDK version: 1.43.0
API version: 1.43.0

What happened?

When using declarative configuration to setup detectors for example:

resource:
  attributes:
    - name: service.name
      value: ${OTEL_SERVICE_NAME:-foo}
  attributes_list: ${OTEL_RESOURCE_ATTRIBUTES:-}
  detection/development:
    detectors:
      - service: {}
      - process: {}
      - host: {}

I'm getting this:

opentelemetry.sdk._configuration._exceptions.ConfigurationError: Failed to validate configuration: Configuration structure is invalid. Check that all required fields are present and correctly typed: Resource.__init__() got an unexpected keyword argument 'detection/development'

Steps to Reproduce

Run the example here: https://github.com/open-telemetry/opentelemetry-python/blob/main/docs/examples/declarative-config/otel-config.yaml and add the detection/development block

Expected Result

Detectors should load fine

Actual Result

Unexpected ConfigurationError

Additional context

detection/development is a valid field for configuration.

Would you like to implement a fix?

Yes

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions