diff --git a/CHANGELOG.md b/CHANGELOG.md index e66abbae8ef..29b3ecdef13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ release. - Clarify that log record mutations are visible in next registered processors. ([#4067](https://github.com/open-telemetry/opentelemetry-specification/pull/4067)) +- Clarify that `Export` MUST NOT be called by simple and batching processors concurrently. + ([#4173](https://github.com/open-telemetry/opentelemetry-specification/pull/4173)) ### Events diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index ffee0340458..5d29e2b6984 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -399,6 +399,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 invoked concurrently. + **Configurable parameters:** * `exporter` - the exporter where the `LogRecord`s are pushed. @@ -409,6 +412,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 invoked concurrently. + **Configurable parameters:** * `exporter` - the exporter where the `LogRecord`s are pushed. @@ -446,6 +452,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: @@ -456,14 +465,15 @@ 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. +`Export` should not be called concurrently with other `Export` calls 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`).