-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk/log: SimpleProcessor synchronizes OnEmit calls (#5666)
From https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#export: > `Export` will never be called concurrently for the same exporter instance. From our SDK perspective this change will make https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutlog concurrent-safe when used with the simple processor. Before the change, there can be multiple goroutines calling `Write` in parallel (via `json.Encoder.Encode`). ### Remarks [Maybe we should simply state that "whole" exporter implementation does not need to be concurrent-safe?](open-telemetry/opentelemetry-specification#4173 (comment)) However: 1. we would need to make complex changes in `BatchExporter` to synchronize the `Export`, `Shutdown`, `ForceFlush` calls 2. we would need to update all exporters (remove synchronization) and simple exporter (add locks to `Shutdown`, `ForceFlush`) 3. I am 100% not sure if this would be compliant with the specification - I think it would be complaint because we would simply give stronger safety-measures We should probably discuss it separately, but I wanted to highlight my though process. Even if we decide that simple and batch processors to synchronize all calls then I would prefer to address it in a separate PR. Related spec clarification PR: - open-telemetry/opentelemetry-specification#4173
- Loading branch information
Showing
4 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters