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

OnEnding should make spans readonly, except within the processor. #1740

Open
dmathieu opened this issue Oct 3, 2024 · 2 comments
Open

OnEnding should make spans readonly, except within the processor. #1740

dmathieu opened this issue Oct 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@dmathieu
Copy link
Member

dmathieu commented Oct 3, 2024

The OnEnding spec mentions:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#onending

The SDK MUST guarantee that the span can no longer be modified by any other thread before invoking OnEnding of the first SpanProcessor

The current OnEnding implementation doesn't prevent the span from being modified in another thread, concurrently with the processor's action.

@dmathieu dmathieu added the bug Something isn't working label Oct 3, 2024
@dmathieu
Copy link
Member Author

dmathieu commented Oct 3, 2024

cc @pantuza

@dmathieu
Copy link
Member Author

dmathieu commented Oct 3, 2024

Two ways this can be done:

Java does it by storing the ID of the thread that runs OnEnding, and prevents any other thread from doing so.
https://github.com/open-telemetry/opentelemetry-java/pull/6367/files#diff-d716139d47f651d6b6558f3e6f03aa59c98e52723f472b2c6a24bd02ec5fe2ceR338-R342

Go is going to setup a wrapper span that allows bypassing the span being read-only, and will be provided to the processor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant