I want to "trace" distributed transactions which pass through "Rabbit MQ" through the Application. The clients for Rabbit MQ are written in python 2.x & Python 3,.x to consume and produce messages.
When in Elastic APM, how do we configure/add/span which shows the "Request -calls which pass through a queue and being processed by the consumer".
Entire lifecycle of the request -> Application > some processing in the server -> generates message in RMQ - > Consumers consume the message.
Each message should be considered as transaction and latency should be calculated.
Even the Request where it went and to which queue ?
If you want to tackle this as a custom instrumentation for your code, you'll need to add the TraceParent to your messages. You should be able to use headers, the same as we do in our kafka instrumentation. You can get the TraceParent string for the current transaction with elasticapm.get_trace_parent_header().
Then, on the receiver end, you can start a new transaction using a TraceParent object from elasticapm.trace_parent_from_string().
If you have an example please share , a pseudo code.
If we have already instrumented and have spans across the distributed application then how do I wire the transaction from there all along to Rabbit mq queue ( producer & consumer)
I know you are very busy guy , however some light would help me
Note that you can also use span links if you're already in an active transaction in your consumer. This is where you link a span to a parent transaction so that they're tied together in the trace view, even though it's not a direct parent/child relationship. There's a links argument in the capture_span context manager.
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.