Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify logs export concurrency #4173

Merged
merged 13 commits into from
Sep 5, 2024
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ release.

- The SDK MAY provide an operation that makes a deep clone of a `ReadWriteLogRecord`.
([#4090](https://github.com/open-telemetry/opentelemetry-specification/pull/4090))
- Clarify that `Export` MUST NOT be called by simple and batching processors concurrently.
([#4173](https://github.com/open-telemetry/opentelemetry-specification/pull/4173))

### Events

Expand Down
16 changes: 12 additions & 4 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ passes the export-friendly `ReadableLogRecord` representation to the
configured [LogRecordExporter](#logrecordexporter), as soon as they are
finished.

The processor MUST synchronize calls to `LogRecordExporter`'s `Export`
to make sure that they are not executed in parallel.
pellared marked this conversation as resolved.
Show resolved Hide resolved

**Configurable parameters:**

* `exporter` - the exporter where the `LogRecord`s are pushed.
Expand All @@ -406,6 +409,9 @@ This is an implementation of the `LogRecordProcessor` which create batches
of `LogRecord`s and passes the export-friendly `ReadableLogRecord`
representations to the configured `LogRecordExporter`.

The processor MUST synchronize calls to `LogRecordExporter`'s `Export`
to make sure that they are not executed in parallel.
pellared marked this conversation as resolved.
Show resolved Hide resolved

**Configurable parameters:**

* `exporter` - the exporter where the `LogRecord`s are pushed.
Expand Down Expand Up @@ -443,6 +449,9 @@ The goal of the interface is to minimize burden of implementation for
protocol-dependent telemetry exporters. The protocol exporter is expected to be
primarily a simple telemetry data encoder and transmitter.

Each implementation MUST document the concurrency characteristics the SDK
requires of the exporter.

### LogRecordExporter operations

A `LogRecordExporter` MUST support the following functions:
Expand All @@ -453,14 +462,13 @@ Exports a batch of [ReadableLogRecords](#readablelogrecord). Protocol exporters
that will implement this function are typically expected to serialize and
transmit the data to the destination.

`Export` will never be called concurrently for the same exporter instance.
reyang marked this conversation as resolved.
Show resolved Hide resolved
`Export` should not be called concurrently for the same exporter instance.
Depending on the implementation the result of the export may be returned to the
Processor not in the return value of the call to `Export` but in a language
specific way for signaling completion of an asynchronous task. This means that
while an instance of an exporter will never have it `Export` called concurrently
while an instance of an exporter should never have it `Export` called concurrently
it does not mean that the task of exporting can not be done concurrently. How
this is done is outside the scope of this specification. Each implementation
MUST document the concurrency characteristics the SDK requires of the exporter.
this is done is outside the scope of this specification.

`Export` MUST NOT block indefinitely, there MUST be a reasonable upper limit
after which the call must time out with an error result (`Failure`).
Expand Down
Loading