Understanding the design choices behind example usage of SpanLinks (as per documentation) #5632
Ayush-Kaushik
started this conversation in
Information Architecture
Replies: 2 comments 2 replies
-
hi @Ayush-Kaushik! I'm going to transfer this to the website repo, since it looks like the source for this page lives over there separately, you may find this helpful: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#trace-structure |
Beta Was this translation helpful? Give feedback.
0 replies
-
the page you linked does not provide a suggested best approach, it just gives an example. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Documentation Link: https://opentelemetry.io/docs/concepts/signals/traces/#span-links
Background:
I have a lambda
ProcessEvents
which processes incoming events in batches. Each event contains unique propagated context which comes from another microservice (lets call itSendEvents
)Now when
ProcessEvents
is invoked, we have a parent span generated. Inside the ProcessEvents lambda, we loop through the batch of events and process them one by one (this operation is denoted by its own unique span created within this loop). This is also where we extract the propagated context from the incoming event.The scenario mentioned above is a perfect use case for SpanLinks. According to OpenTelemetry documentation, the best approach to show the association among propagated context from SendEvents, Parent span of ProcessEvents and child span created when each event is processed in loop is:
but why was this approach chosen in first place? Why didn't we go with this approach instead:
Does one approach hold merit over the other? It'll be helpful if some more clarification is provided over SpanLinks usage in documentation.
Beta Was this translation helpful? Give feedback.
All reactions