opentelemetry-configuration icon indicating copy to clipboard operation
opentelemetry-configuration copied to clipboard

Improve key/value pairs in headers

Open marcalff opened this issue 1 year ago • 2 comments

In the Headers node, key/values are represented like this currently:

headers:
  key_a: value_a
  key_b: value_b
  api-key: 1234

The key name appear as a node name, on the left hand side (LHS).

Issue 1: This most likely adds some constraints on the name itself, due to yaml.

Can key names that include special characters be represented ?

Issue 2: The key name can not be substituted with environment variables.

This is a concern for keys like api-key, where the exact key name to use can be vendor dependent: it is highly desirable to abstract this away.

Proposed solution:

headers:
  - key:
    name: key_a
    value: value_a
  - key:
    name: "key_b#from%Hell$$" <-- fixes issue 1
    value: value_b
  - key:
    name: ${VENDOR_AUTH_KEY_NAME} <-- fixes issue 2
    value: ${VENDOR_AUTH_KEY_TOKEN}

marcalff avatar Feb 08 '24 23:02 marcalff