I wonder if it's possible to do distributed tracing with custom transactions?
I see there is an automated distributed tracing for services communicating via HTTP.
But what about other means of IPC, like message brokers or child processes, and custom transactions?
I was experimenting with child processes, but haven't got much of a result.
I tried to do the following:
On master process I started a transaction as usual.
const transaction = agent.startTransaction('dt-master', 'job');
Then I tried to extract and pass to the child process transaction and trace IDs, which actually already seemed hack-ish:
await callChild( transaction._context.traceId, transaction._context.id);
Then I used these IDs as the 3rd argument to the
agent.startTransaction() function in a child process:
const childTransaction = agent.startTransaction('dt-child', 'job', id); // or const childTransaction = agent.startTransaction('dt-child', 'job', traceId);
Then I added some spans to both transactions and flushed the agent.
But in both cases I got two separate transactions in APM UI.
So, I wonder, is there any way to do it properly?