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.
The third argument to agent.startTransaction(...) should be the context object itself. You can do transaction._context.toString() to get the complete context in a string format to pass to the other process. Also, I would recommend using the context of the nearest span, if you can, rather than a transaction, so the UI can nest it better.
Also, just a minor note: we aren't currently officially supporting the argument to pass in the traceparent header value, so it's possible that interface could change. It seems like there's a use case for it though, so I'll see about making that official.
Just to weigh in on what Stephen said above: I suggest that you pay attention to our CHANGELOG to see when we release official support for this.
And I would also urge you to guard against what will happen if _context is undefined as this is a private API that might change in a patch version without warning. So you could do something like this:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.