Skip to content

Commit 4b8f95c

Browse files
zeitlingertraskjack-bergcarlosalberto
authored
instrumentation config: return empty object when not set (#4817)
Fixes open-telemetry/opentelemetry-java#7958 ## Changes While working on Java, it has turned out to be more convenient to work with empty config objects rather than null/nil. - null requires an explicit if, making the code more verbose - it doesn't matter if the `.instrumentation` is missing or is empty, which is a different question than "is declarative config used") * [x] Related issues: open-telemetry/opentelemetry-java#7927 (comment) * [ ] Related [OTEP(s)](https://github.com/open-telemetry/oteps) # * [x] Links to the prototypes (when adding or changing features): open-telemetry/opentelemetry-java#7954 * [ ] [`CHANGELOG.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CHANGELOG.md) file updated for non-trivial changes * [ ] [Spec compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix/template.yaml) updated if necessary --------- Co-authored-by: Trask Stalnaker <[email protected]> Co-authored-by: Jack Berg <[email protected]> Co-authored-by: Carlos Alberto Cortez <[email protected]>
1 parent e0a5864 commit 4b8f95c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ release.
6969
([#4802](https://github.com/open-telemetry/opentelemetry-specification/pull/4802))
7070
- Declarative configuration: clarify Registry ComponentProvider `type` parameter
7171
([#4799](https://github.com/open-telemetry/opentelemetry-specification/pull/4799))
72+
- Declarative configuration: Update instrumentation config behavior to return
73+
empty object when not set
74+
([#4817](https://github.com/open-telemetry/opentelemetry-specification/pull/4817))
7275
- Swap Tracer/Meter/LoggerConfig `disabled` for `enabled` to avoid double negatives
7376
([#4823](https://github.com/open-telemetry/opentelemetry-specification/pull/4823))
7477

specification/configuration/api.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ Obtain configuration relevant to instrumentation libraries.
6060
the [`.instrumentation`](https://github.com/open-telemetry/opentelemetry-configuration/blob/670901762dd5cce1eecee423b8660e69f71ef4be/examples/kitchen-sink.yaml#L438-L439)
6161
configuration mapping node.
6262

63-
If the `.instrumentation` node is not set, get instrumentation config MUST
64-
return nil, null, undefined or another language-specific idiomatic pattern
65-
denoting empty.
63+
If the `.instrumentation` node is not set, get instrumentation config SHOULD
64+
return an empty `ConfigProperties` (as if `.instrumentation: {}` was set).
6665

6766
### ConfigProperties
6867

0 commit comments

Comments
 (0)