Improve concurrency safety description of LogRecordProcessor.OnEmit#4578
Merged
carlosalberto merged 14 commits intoopen-telemetry:mainfrom Jul 28, 2025
Merged
Conversation
Member
Author
|
@cijothomas, @jack-berg, are you able to review? |
MrAlias
reviewed
Jul 9, 2025
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
MrAlias
reviewed
Jul 9, 2025
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
MrAlias
approved these changes
Jul 9, 2025
Kielek
approved these changes
Jul 10, 2025
reyang
approved these changes
Jul 10, 2025
cijothomas
approved these changes
Jul 10, 2025
jack-berg
reviewed
Jul 10, 2025
Member
jack-berg
left a comment
There was a problem hiding this comment.
The spirit of the concurrent phrasing was to discourage users from holding on to references to logRecord and updating them after OnEmit returns. This is reflected subtly in "If logRecord is needed after OnEmit returns (i.e. for
asynchronous processing) only reads are permitted." which notably does not use any normative language.
Still, its too subtle what guidance is for SDK maintainers and what is for end users, so I support clarifying.
Contributor
|
We will merge this one after July's release, so we will hold on for a bit. |
jack-berg
approved these changes
Jul 18, 2025
Merged
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Aug 13, 2025
August 2025 release. ### Logs - Improve concurrency safety description of `LogRecordProcessor.OnEmit`. ([#4578](#4578)) - Clarify that `SeverityNumber` values are used when comparing severities. ([#4552](#4552)) ### Entities - Mention entity references in the stability guarantees. ([#4593](#4593)) ### OpenTelemetry Protocol - Clarify protocol defaults on specification. ([#4585](#4585)) ### Compatibility - Flexibilie escaping of characters that are discouraged by Prometheus Conventions in Prometheus exporters. ([#4533](#4533)) - Flexibilize addition of unit/type related suffixes in Prometheus exporters. ([#4533](#4533)) - Define the configuration option "Translation Strategies" for Prometheus exporters. ([#4533](#4533)) - Define conversion of Prometheus native histograms to OpenTelemetry exponential histograms. ([#4561](#4561)) - Clarify what to do when scope attribute conflicts with name, version and schema URL. ([#4599](#4599)) ### SDK Configuration - Enum values provided via environment variables SHOULD be interpreted in a case-insensitive manner. ([#4576](#4576)) Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4141
Why
I do not think it is possible to disallow modifications of
logRecordafterLogRecordProcessor.OnEmit. It is a "requirement" that is left for the user.What
Instead of it I think we should explain the problem and also describe ways how race conditions can be mitigated/solved.
This is how we implemented it in OTel Go:
PS: Sorry it took me so long to create this PR (almost a year 😅). It actually took me more than an hour just to figure out how to propose these changes in a hopefully good way. Thank you for your patience!