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

Producer SpanKind does not always imply a remote call #371

Merged
merged 5 commits into from
Dec 10, 2019

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Dec 4, 2019

It's popular in asynchronous scenarios to send messages in batches.

In this case, each message should carry a unique context to be individually traceable. Arguably it means creating span per message. Such spans do not represent remote calls.

Sending a batch (which is remote outgoing call) is represented by a different span that is linked to all of the messages span contexts.

So async messaging scenarios with batching involve

  • message spans with PRODUCER kind (each of them is a parent of asynchronous request)
  • send span that is CLIENT kind (which is remote outgoing call). But it is not a parent of any asynchronous request

In some cases (not involving batching) it is possible that dedicated message span is not needed and send may represent both: context in the message and remote outgoing call. In this case, such span should have PRODUCER kind

It's popular in asynchronous scenarios to send messages in batches.

In this case, each message may (and should) carry a unique context to be individually traceable. Arguably it means creating span per message.

Sending a batch (which is remote outgoing call) is represented by a different span that is linked to all of the messages span contexts.

So async messaging scenarios with batching involve
* *message* spans and they map to PRODUCER kind (they are parent of asynchronous request)
* *send* span that is CLIENT kind (which is remote outgoing call). But it is not a parent of any asynchronous request

In some cases (not involving batching) it is possible that dedicated *message* span is not needed and *send* may represent both: context in the message and remote outgoing call. In this case, such span should have PRODUCER kind
@jmacd
Copy link
Contributor

jmacd commented Dec 5, 2019

Could you update the spec language to explain why PRODUCER may or may not be remote? Also I suspect that if PRODUCER has this property, so does CONSUMER. Should they both be marked maybes?

@lmolkova
Copy link
Contributor Author

lmolkova commented Dec 6, 2019

@jmacd sure, done.

I wish we had a spec for async messaging documented, but it should not block v1. I will try to come up with one

@carlosalberto
Copy link
Contributor

Not sure "may be" is clear enough, but otherwise it looks good to me.

specification/api-tracing.md Outdated Show resolved Hide resolved
specification/api-tracing.md Outdated Show resolved Hide resolved
specification/api-tracing.md Outdated Show resolved Hide resolved
Liudmila Molkova added 2 commits December 6, 2019 21:09
@SergeyKanzhelev
Copy link
Member

Active for more than 3 days and have enough sign offs. Merging

@SergeyKanzhelev SergeyKanzhelev merged commit d5928df into open-telemetry:master Dec 10, 2019
SergeyKanzhelev pushed a commit to SergeyKanzhelev/opentelemetry-specification that referenced this pull request Feb 18, 2020
…#371)

* Producer SpanKind is not always a remote call

It's popular in asynchronous scenarios to send messages in batches.

In this case, each message may (and should) carry a unique context to be individually traceable. Arguably it means creating span per message.

Sending a batch (which is remote outgoing call) is represented by a different span that is linked to all of the messages span contexts.

So async messaging scenarios with batching involve
* *message* spans and they map to PRODUCER kind (they are parent of asynchronous request)
* *send* span that is CLIENT kind (which is remote outgoing call). But it is not a parent of any asynchronous request

In some cases (not involving batching) it is possible that dedicated *message* span is not needed and *send* may represent both: context in the message and remote outgoing call. In this case, such span should have PRODUCER kind

* Explain why producer spans are not necessarily remote and async scenarios also could be local

* review comments

* lint
@lmolkova lmolkova mentioned this pull request Aug 24, 2024
2 tasks
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
…#371)

* Producer SpanKind is not always a remote call

It's popular in asynchronous scenarios to send messages in batches.

In this case, each message may (and should) carry a unique context to be individually traceable. Arguably it means creating span per message.

Sending a batch (which is remote outgoing call) is represented by a different span that is linked to all of the messages span contexts.

So async messaging scenarios with batching involve
* *message* spans and they map to PRODUCER kind (they are parent of asynchronous request)
* *send* span that is CLIENT kind (which is remote outgoing call). But it is not a parent of any asynchronous request

In some cases (not involving batching) it is possible that dedicated *message* span is not needed and *send* may represent both: context in the message and remote outgoing call. In this case, such span should have PRODUCER kind

* Explain why producer spans are not necessarily remote and async scenarios also could be local

* review comments

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants