Skip to content

Remove "It is not necessary for implementations to ensure that changes to any of these parameters are immediately visible to callers of Enabled." #4643

@pellared

Description

@pellared

returns `false`. If `disabled` is `false`, `Enabled` returns `true`. It is not
necessary for implementations to ensure that changes to `disabled` are
immediately visible to callers of `Enabled`.

Why? This should be visible at the same time as for callers of Emit a LogRecord. Otherwise, the result Enabled is not trustworthy.

One may see this as acceptable:

It is not necessary for implementations to ensure that changes to any of these
parameters are immediately visible to callers of `Enabled` and `Emit a LogRecord`.

However, I do not think it is a good idea. If users changes a configuration, they expect that it is reflected in subsequent method calls.
I think that such statement can promote buggy, not properly synchronized implementations.

It would be also not consistent with the rationale behind Enabled:

The returned value is not always static, it can change over time. The API
SHOULD be documented that instrumentation authors needs to call this API each
time they [emit a LogRecord](#emit-a-logrecord) to ensure they have the most
up-to-date response.

It is also not consistent with the Enabled section in this (SDK) document:

`Enabled` MUST return `false` when either:
- there are no registered [`LogRecordProcessors`](#logrecordprocessor),
- **Status**: [Development](../document-status.md) - `Logger` is disabled
([`LoggerConfig.disabled`](#loggerconfig) is `true`),

I propose remove this statement completely and let the SIGs decide how they want to synchronize.

This statement is also in other parts of the specification (TracerConfig and MeterConfig) and should be removed from those places as well. Therefore, this comment should probably be better addressed in a separate PR.

Originally posted by @pellared in #4612 (comment)

Metadata

Metadata

Assignees

Labels

area:sdkRelated to the SDKspec:logsRelated to the specification/logs directoryspec:metricsRelated to the specification/metrics directoryspec:traceRelated to the specification/trace directorytriage:deciding:community-feedbackOpen to community discussion. If the community can provide sufficient reasoning, it may be accepted

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions