opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

default value for header setter extension

Open f7o opened this issue 6 months ago • 6 comments

Component(s)

extension/headerssetter

Is your feature request related to a problem? Please describe.

When using the header setter with from_context configuration set, and the key is not set within context from receiver, the header is set to nil on the exporter.

Describe the solution you'd like

  extensions:
    headers_setter:
      headers:
        - action: upsert
          key: X-TENANT
          from_context: X-TENANT
          default_value: my-tenant-1 # new proposed config field

Describe alternatives you've considered

Allow to specify a default value per header action in case X-TENANT on the provided context is empty/nil

Additional context

No response

f7o avatar Aug 06 '24 02:08 f7o