Skip to content

Conversation

jack-berg
Copy link
Member

Resolves #72.

May also resolve open-telemetry/opentelemetry-specification#2857.

This PR migrates .resource.attributes and *.otlp.headers to be key-value pairs instead of objects, and adds a modeling rule to follow this pattern for similar situations in the future. To repeat the reasoning from the modeling rule:

When a type requires a configurable list of name-value pairs (i.e. resource attributes, HTTP headers), model using an array of objects, each with name and value properties. While an arrays of name-value objects is slightly more verbose an object where each key-value is an entry, it is preferred because:

  • Avoids user input as keys, which ensures conformity with the snake_case properties rule.
  • Allows both the names and the values to be targets for [env var substitution].

The more I think about it, the more I think this the way the way to go. Note that this is how environment variables are specified in kubernetes manifests, so it shouldn't be particularly foreign to users.

We should get this change in sooner than later to minimize the number of users we expose to churn.

@jack-berg jack-berg requested a review from a team August 30, 2024 19:28
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

See comments.

@jack-berg jack-berg force-pushed the prefer-name-value-pairs branch from a4248d9 to 2849441 Compare September 3, 2024 20:47
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of comments, otherwise this looks ok to me

@jack-berg jack-berg mentioned this pull request Sep 17, 2024
@jack-berg jack-berg requested a review from a team September 18, 2024 15:44
@jack-berg
Copy link
Member Author

@marcalff, @codeboten - I've resolved merge conflicts and incorporated feedback. Can you take another look? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve key/value pairs in headers Provide clarity on how non-string attributes are supposed to be provided through OTEL_RESOURCE_ATTRIBUTES

4 participants