Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ release.
([#4536](https://github.com/open-telemetry/opentelemetry-specification/pull/4536))
- `SeverityNumber=0` MAY be used to represent an unspecified value.
([#4535](https://github.com/open-telemetry/opentelemetry-specification/pull/4535))
- Improve concurrency safety description of `LogRecordProcessor.OnEmit`.
([#4578](https://github.com/open-telemetry/opentelemetry-specification/pull/4578))

### Baggage

Expand Down
12 changes: 8 additions & 4 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ the following information added to the [LogRecord](data-model.md#log-and-event-r
The SDK MAY provide an operation that makes a deep clone of a `ReadWriteLogRecord`.
The operation can be used by asynchronous processors (e.g. [Batching processor](#batching-processor))
to avoid race conditions on the log record that is not required to be
concurrent safe.
concurrent-safe.

## LogRecord Limits

Expand Down Expand Up @@ -350,9 +350,13 @@ therefore it SHOULD NOT block or throw exceptions.
For a `LogRecordProcessor` registered directly on SDK `LoggerProvider`,
the `logRecord` mutations MUST be visible in next registered processors.

A `LogRecordProcessor` may freely modify `logRecord` for the duration of
the `OnEmit` call. If `logRecord` is needed after `OnEmit` returns (i.e. for
asynchronous processing) only reads are permitted.
A `LogRecordProcessor` may freely modify the `logRecord` for the duration of
the `OnEmit` call. However, it is OPTIONAL for `ReadWriteLogRecord` to be
concurrent-safe. Therefore, any modification to `logRecord` concurrent
Comment thread
jack-berg marked this conversation as resolved.
Outdated
with `OnEmit` or after `OnEmit` returns (for example, during asynchronous
Comment thread
pellared marked this conversation as resolved.
Outdated
processing) may result in race conditions. To avoid such race conditions,
implementations SHOULD recommended to users that a clone of `logRecord`
be used for any asynchronous processing, such as in a [batching processor](#batching-processor).

#### Enabled

Expand Down
Loading