Skip to content

Commit

Permalink
Merge branch 'prefer-name-value-pairs' of https://github.com/jack-ber…
Browse files Browse the repository at this point in the history
…g/opentelemetry-configuration into prefer-name-value-pairs
  • Loading branch information
jack-berg committed Sep 18, 2024
2 parents ad50656 + 5fb350f commit a251d94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ In instances where there is a type mismatch between the JSON schema and equivale

### Name-value pairs

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:
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 array of name-value objects is slightly more verbose than an object where each key-value is an entry, the latter is preferred because:

* Avoids user input as keys, which ensures conformity with the [snake_case properties](#property-name-case) rule.
* Allows both the names and the values to be targets for [env var substitution]. For example:
Expand Down
2 changes: 1 addition & 1 deletion examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ resource:
# Configure `service.name` resource attribute
#
# Environment variable: OTEL_SERVICE_NAME
- name: service-name
- name: service.name
value: unknown_service
# Configure other resource attributes with explicit types.
- name: string_key
Expand Down

0 comments on commit a251d94

Please sign in to comment.