Skip to content

Commit fbe98fe

Browse files
authored
Swap Tracer/Meter/LoggerConfig disabled for enabled to avoid double negatives (#4823)
(this change has been unblocked by #4723) This will help avoid double negatives (`disabled: false`) in declarative configuration, e.g. instead of [ExperimentalTracerConfigurator_kitchen_sink.yaml](https://github.com/open-telemetry/opentelemetry-configuration/blob/17d87ca756fe2cc5106d3f84be03c5dcc0184ef7/snippets/ExperimentalTracerConfigurator_kitchen_sink.yaml#L8-L15): ``` tracer_provider: tracer_configurator/development: default_config: disabled: true tracers: - name: io.opentelemetry.contrib.* config: disabled: false ``` if this PR is accepted, we would change this to: ``` tracer_provider: tracer_configurator/development: default_config: enabled: false tracers: - name: io.opentelemetry.contrib.* config: enabled: true ``` FWIW, this matches similar existing usage of enabled (over disabled) in the Java agent: - `otel.instrumentation.common.default-enabled` - `otel.instrumentation.<name>.enabled`
1 parent c7b5653 commit fbe98fe

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ release.
5858
([#4802](https://github.com/open-telemetry/opentelemetry-specification/pull/4802))
5959
- Declarative configuration: clarify Registry ComponentProvider `type` parameter
6060
([#4799](https://github.com/open-telemetry/opentelemetry-specification/pull/4799))
61+
- Swap Tracer/Meter/LoggerConfig `disabled` for `enabled` to avoid double negatives
62+
([#4823](https://github.com/open-telemetry/opentelemetry-specification/pull/4823))
6163

6264
### Common
6365

specification/logs/sdk.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ the `Logger` MUST be updated to behave according to the new `LoggerConfig`.
186186
A `LoggerConfig` defines various configurable aspects of a `Logger`'s behavior.
187187
It consists of the following parameters:
188188

189-
* `disabled`: A boolean indication of whether the logger is enabled.
189+
* `enabled`: A boolean indication of whether the logger is enabled.
190190

191-
If not explicitly set, the `disabled` parameter SHOULD default to `false` (
191+
If not explicitly set, the `enabled` parameter SHOULD default to `true` (
192192
i.e. `Logger`s are enabled by default).
193193

194194
If a `Logger` is disabled, it MUST behave equivalently
@@ -245,7 +245,7 @@ emitting the record):
245245

246246
- there are no registered [`LogRecordProcessors`](#logrecordprocessor).
247247
- **Status**: [Development](../document-status.md) - `Logger` is disabled
248-
([`LoggerConfig.disabled`](#loggerconfig) is `true`).
248+
([`LoggerConfig.enabled`](#loggerconfig) is `false`).
249249
- **Status**: [Development](../document-status.md) - the provided severity
250250
is specified (i.e. not `0`) and is less than the configured `minimum_severity` in the
251251
[`LoggerConfig`](#loggerconfig).

specification/metrics/sdk.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -860,15 +860,15 @@ the `Meter` MUST be updated to behave according to the new `MeterConfig`.
860860
A `MeterConfig` defines various configurable aspects of a `Meter`'s behavior.
861861
It consists of the following parameters:
862862

863-
* `disabled`: A boolean indication of whether the Meter is enabled.
863+
* `enabled`: A boolean indication of whether the Meter is enabled.
864864

865-
If not explicitly set, the `disabled` parameter SHOULD default to `false` (
865+
If not explicitly set, the `enabled` parameter SHOULD default to `true` (
866866
i.e. `Meter`s are enabled by default).
867867

868868
If a `Meter` is disabled, it MUST behave equivalently
869869
to [No-op Meter](./noop.md#meter).
870870

871-
The value of `disabled` MUST be used to resolve whether an instrument
871+
The value of `enabled` MUST be used to resolve whether an instrument
872872
is [Enabled](./api.md#enabled). See [Instrument Enabled](#instrument-enabled)
873873
for details.
874874

@@ -1005,15 +1005,15 @@ The synchronous instrument [`Enabled`](./api.md#enabled) MUST return `false`
10051005
when either:
10061006

10071007
- **Status**: [Development](../document-status.md) - The [MeterConfig](#meterconfig)
1008-
of the `Meter` used to create the instrument has parameter `disabled=true`.
1008+
of the `Meter` used to create the instrument has parameter `enabled=false`.
10091009
- All [resolved views](#measurement-processing) for the instrument are
10101010
configured with the [Drop Aggregation](#drop-aggregation).
10111011

10121012
Otherwise, it SHOULD return `true`.
10131013
It MAY return `false` to support additional optimizations and features.
10141014

10151015
Note: If a user makes no configuration changes, `Enabled` returns `true` since by
1016-
default `MeterConfig.disabled=false` and instruments use the default
1016+
default `MeterConfig.enabled=true` and instruments use the default
10171017
aggregation when no matching views match the instrument.
10181018

10191019
## Attribute limits

specification/trace/sdk.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,17 @@ the `Tracer` MUST be updated to behave according to the new `TracerConfig`.
200200
A `TracerConfig` defines various configurable aspects of a `Tracer`'s behavior.
201201
It consists of the following parameters:
202202

203-
* `disabled`: A boolean indication of whether the Tracer is enabled.
203+
* `enabled`: A boolean indication of whether the Tracer is enabled.
204204

205-
If not explicitly set, the `disabled` parameter SHOULD default to `false` (
205+
If not explicitly set, the `enabled` parameter SHOULD default to `true` (
206206
i.e. `Tracer`s are enabled by default).
207207

208208
If a `Tracer` is disabled, it MUST behave equivalently
209209
to a [No-op Tracer](./api.md#behavior-of-the-api-in-the-absence-of-an-installed-sdk).
210210

211-
The value of `disabled` MUST be used to resolve whether a `Tracer`
212-
is [Enabled](./api.md#enabled). If `disabled` is `true`, `Enabled`
213-
returns `false`. If `disabled` is `false`, `Enabled` returns `true`.
211+
The value of `enabled` MUST be used to resolve whether a `Tracer`
212+
is [Enabled](./api.md#enabled). If `enabled` is `false`, `Enabled`
213+
returns `false`. If `enabled` is `true`, `Enabled` returns `true`.
214214

215215
It is not necessary for implementations to ensure that changes to any of these
216216
parameters are immediately visible to callers of `Enabled`.
@@ -223,7 +223,7 @@ However, the changes MUST be eventually visible.
223223
`Enabled` MUST return `false` when either:
224224

225225
- there are no registered [`SpanProcessors`](#span-processor),
226-
- `Tracer` is disabled ([`TracerConfig.disabled`](#tracerconfig) is `true`).
226+
- `Tracer` is disabled ([`TracerConfig.enabled`](#tracerconfig) is `false`).
227227

228228
Otherwise, it SHOULD return `true`.
229229
It MAY return `false` to support additional optimizations and features.

0 commit comments

Comments
 (0)