Skip to content

Commit 57d683c

Browse files
Define how SDK implements Tracer.Enabled (#4537)
Fixes #4397 Towards #4463 Content is based on https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#enabled. --------- Co-authored-by: Carlos Alberto Cortez <calberto.cortez@gmail.com>
1 parent 8f01d12 commit 57d683c

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ release.
1111

1212
### Traces
1313

14+
- Define how SDK implements `Tracer.Enabled`.
15+
([#4537](https://github.com/open-telemetry/opentelemetry-specification/pull/4537))
16+
1417
### Metrics
1518

1619
### Logs

specification/logs/sdk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ the implementation SHOULD set it equal to the current time.
202202

203203
**Status**: [Development](../document-status.md)
204204

205-
`Enabled` MUST return `false` when:
205+
`Enabled` MUST return `false` when either:
206206

207207
- there are no registered [`LogRecordProcessors`](#logrecordprocessor),
208208
- `Logger` is disabled ([`LoggerConfig.disabled`](#loggerconfig) is `true`),

specification/trace/sdk.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ linkTitle: SDK
1919
* [ForceFlush](#forceflush)
2020
- [Tracer](#tracer)
2121
* [TracerConfig](#tracerconfig)
22+
* [Enabled](#enabled)
2223
- [Additional Span Interfaces](#additional-span-interfaces)
2324
- [Sampling](#sampling)
2425
* [Recording Sampled reaction table](#recording-sampled-reaction-table)
@@ -199,6 +200,18 @@ It consists of the following parameters:
199200
necessary for implementations to ensure that changes to `disabled` are
200201
immediately visible to callers of `Enabled`.
201202

203+
### Enabled
204+
205+
**Status**: [Development](../document-status.md)
206+
207+
`Enabled` MUST return `false` when either:
208+
209+
- there are no registered [`SpanProcessors`](#span-processor),
210+
- `Tracer` is disabled ([`TracerConfig.disabled`](#tracerconfig) is `true`).
211+
212+
Otherwise, it SHOULD return `true`.
213+
It MAY return `false` to support additional optimizations and features.
214+
202215
## Additional Span Interfaces
203216

204217
The [API-level definition for Span's interface](api.md#span-operations)

0 commit comments

Comments
 (0)