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

How to properly use OpenTelemetry to instrument fork-join (or in fact, join-fork / gather & scatter) of multiple traces? #1705

Open
mitoihs opened this issue Jan 19, 2021 · 2 comments
Labels
question Further information is requested

Comments

@mitoihs
Copy link

mitoihs commented Jan 19, 2021

Question

Describe your environment.

Microservices in C#. Diagram which shows a problematic part:
timeline

What are you trying to achieve?

One of my microservices batches messages from other ones and process them in a mixed way - processing operations and messages are in many-to-many relationship. It can process multiple messages in a single operation and a single message can be processed part by part with multiple operations.

I thought that I should create traces like:
trace
but the documentation says:

When using the scatter/gather (also called fork/join) pattern, the root operation starts multiple downstream processing operations and all of them are aggregated back in a single Span. This last Span is linked to many operations it aggregates. All of them are the Spans from the same Trace. And similar to the Parent field of a Span. It is recommended, however, to not set the parent of the Span in this scenario as semantically the parent field represents a single parent scenario, in many cases the parent Span fully encloses the child Span. This is not the case in scatter/gather and batch scenarios.

So what should I do when I have a span which is related to multiple traces?

I'm aware that there are no tools that could display traces from my scenario in a logically correct way, that's not an issue for me. (but if you know any which may support such a scenario, I'd be grateful)

@mitoihs mitoihs added the question Further information is requested label Jan 19, 2021
@rholdorf
Copy link

rholdorf commented Apr 4, 2022

I have a very similar scenario. Any progress on how to do it properly?

@mjpowersjr
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants