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 spans export concurrency #4205

Merged
merged 10 commits into from
Sep 30, 2024

Conversation

pellared
Copy link
Member

@pellared pellared commented Sep 10, 2024

Same as #4173 for trace SDK.

Fixes #4134

@pellared pellared added area:sdk Related to the SDK spec:trace Related to the specification/trace directory clarification clarify ambiguity in specification labels Sep 10, 2024
@pellared pellared marked this pull request as ready for review September 10, 2024 08:43
@pellared pellared requested review from a team September 10, 2024 08:43
@pellared pellared mentioned this pull request Sep 10, 2024
Copy link
Member

@tsloughter tsloughter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary changes but had some questions.

specification/trace/sdk.md Show resolved Hide resolved
specification/trace/sdk.md Show resolved Hide resolved
@carlosalberto
Copy link
Contributor

Ping @tsloughter

@reyang reyang requested review from a team as code owners September 19, 2024 16:15
specification/trace/sdk.md Show resolved Hide resolved
specification/trace/sdk.md Show resolved Hide resolved
@tsloughter
Copy link
Member

Before my PR #2452 I was originally pushing for a change to allow Export() to be called concurrently. I wish I could remember who it was that most convinced me so I could ping them. I believe it was the simplicity that sold me

If we make a change that Export can be called concurrently or make the current BSP legacy or add a new ConcurrentBSP it means exporters written with this guarantee in mind (example: writing to a raw file) will now fail in confusing ways until they are updated to support concurrent calls. I don't think keeping the current processor and having another that calls concurrently is great either since now the user has to ensure they use the right one.

Implementations exist that support concurrency from the BatchProcessor based on the changes we did before:

I know this PR was only about limiting it to the builtin processors and not changing the builtin processors but I think important to keep this standard for all processors, even if it can't be guaranteed by the API design by everyone to not add this confusion to the user. Originally I thought it was just clarifying it for all processors but had misread :).

@pellared
Copy link
Member Author

pellared commented Sep 24, 2024

@tsloughter, I think that this PR still keeps the statements that discourages from having concurrent-safe exporters. It mostly changes "will" into "should" as e.g. not all languages are able to enforce such constraint. It adds normative requirements to built-in processors as this is a place where all languages have control. Having more normative statements in places where they can be added helps in reviewing/auditing the SDK implementations. As you can see, I do not want to make further changes in this PR which may be controversial. I think the proposed changes are mostly editorial+clarification.

@tsloughter
Copy link
Member

@pellared right, that is how I initially read it but I think the should instead of must for replacing will changes the meaning too much. A should on this basically makes it a must support concurrency since you don't actually know. Even if today you know all processors in your language won't call it concurrently that is no guarantee that an upgrade won't change that in a third party processor or a new processor added to the spec that the user could enable instead of Simple or Batch.

Having it be a must you can at least point to the spec if it breaks and say, 'this processor isn't spec compliant', when an exporter doesn't function properly :).

I mainly want to make sure my concerns are clear but not actually hold this up if it has enough support. I think it prevents merging if there are unresolved conversations? If no one shares my concerns, or thinks things need to be done in a new PR after this one is merged, I can resolve them to not block on just my concern.

@pellared
Copy link
Member Author

@carlosalberto, I think we have a consensus and this PR can be merged. More refining PRs are welcome but let's avoid scope creep in this PR.

@carlosalberto
Copy link
Contributor

Will merge by EOD today as, yes, we simply clarify the existing behavior of simple/batch processors.

Btw @jmacd @bogdandrutu as you are interested in concurrent capabilities, maybe we can think of expanding this for future processors. Maybe create an issue to track that? Otherwise, wait for it to happen, etc.

@cijothomas
Copy link
Member

Will merge by EOD today as, yes, we simply clarify the existing behavior of simple/batch processors.

Btw @jmacd @bogdandrutu as you are interested in concurrent capabilities, maybe we can think of expanding this for future processors. Maybe create an issue to track that? Otherwise, wait for it to happen, etc.

Opened this for tracking #4231

@carlosalberto carlosalberto merged commit ee9207f into open-telemetry:main Sep 30, 2024
6 checks passed
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sdk Related to the SDK clarification clarify ambiguity in specification spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarification on SimpleProcessor concurrency
9 participants