Correlating spans with links
So far, we have talked about parent-child relationships between spans. They cover request-response scenarios well and allow us to describe distributed call stacks as a tree, where each span has at most one parent and as many children as needed.
But what if our scenarios are more complicated? For example, how do we express receiving temperature data from multiple sensors and aggregating it on the backend, as shown in Figure 6.4?
Figure 6.4 – Batch processing
In this example, sensors send data to the aggregator in the scope of different traces. The aggregator must start a third one – it shouldn’t continue one of the sensor’s traces.
We can use links to connect trace3
to both trace1
and trace2
, allowing us to correlate all of them. Links don’t specify exact relationships between spans, but in the scope of this example, we can think about them as multiple parents for a single span.
Links...