I'm a newbie on Jaeger and would like to know if I could trace an end-to-end transaction with a parent span & child ones like the one described below with polling from child components (no direct invocation from parent to child) and callback from childs to the parent component.
Context:
First let's describe a simplified view of what I'd like to do. A solution made of several components exposes a REST API to submit transactions. It synchronously returns a transaction Id after invocation and will callback the invoker upon completion or failure of the transaction. So what I want to trace is the overall transaction from 1 to 3:
- invoker calls solution REST API with transaction input parameters & a callback url
- invoker receives an Id from REST API response
- solution call the invoker callback url with that Id
Under the hood:
- the component (C1) exposing the REST API to submit transaction will perform some actions and then place the transaction in a queue.This is the parent component I was referring to above.
- a second component (C2) will poll C1 using an internal REST API to fetch the transaction from the queue and then invoke the REST API exposed by a third component (C3) to further execute actions related to the transaction. In the message C1 propagates a callback url which is then propagated by C2 to C3.
- the third component (C3) will inform C1 that it starts to process the transaction by invoking the propagated callback to C1 with IN-PROGRESS
- and then C3 orchestrates many actions invoking synchronously (request<->response) or asynchronously (request<->response & then <-callback) different other components
- When all actions are completed successfully or when one fails with a un-recoverable error, then component C3 will callback back again C1 to indicate SUCCESS or FAILURE.
- When C1 is invoked by C3, it then performs some closing actions and invokes the callback of the transaction invoker.
I'm assuming that it will be possible to trace the entire transaction with Jaeger, but here are my questions: Question:
- Q1: Am I right ? :-)
- Q2: How to convey/propagate the parent span created in C1 to C2 ? (between step 1 & 2). I'm thinking at adding the SpanContext in a map as a new attribute of the transaction ?
- Q3: Assuming C2 got the span it can propagate it to C3 and as C3 will invoke several times the callback to C1 (steps 3 & 5) how to correlate these callbacks invocation in C1 with the parent span ?
Any hints & tips will be welcome. Thx.