Skip to content

Commit

Permalink
Allow cloning of ReadWriteLogRecord (#4090)
Browse files Browse the repository at this point in the history
Follows
#4062

## Why

1. There is a need to make a deep copy of a `ReadWriteRecord` in order
to implement an experimental isolating processor outside of the SDK (as
it is experimental, we prefer to land it to contrib repository first).
2. Allow fine-grained control for the users to make a deep copy only
when necessary. This allows users to have more control on the processing
e.g. pass a clone to asynchronous processor to avoid race conditions or
make performance improvements.
  • Loading branch information
pellared authored Jul 26, 2024
1 parent c55650e commit 1c7eb21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ release.

### Logs

- The SDK MAY provide an operation that makes a deep clone of a `ReadWriteLogRecord`.
([#4090](https://github.com/open-telemetry/opentelemetry-specification/pull/4090))

### Events

### Resource
Expand Down
6 changes: 6 additions & 0 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ the following information added to the [LogRecord](data-model.md#log-and-event-r
* [`SpanId`](./data-model.md#field-spanid)
* [`TraceFlags`](./data-model.md#field-traceflags)

The SDK MAY provide an operation that makes a deep clone of a `ReadWriteLogRecord`.
The operation can be used to implement the [isolating processor](#isolating-processor)
or 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.

## LogRecord Limits

`LogRecord` attributes MUST adhere to
Expand Down

0 comments on commit 1c7eb21

Please sign in to comment.