If you are using Kafka clients (and not Kafka streams) and a supported Kafka version, than this should work. If that doesn't work, several questions:
What Java agent version are you using?
Do you get transactions for api-1? If not, then you would have to manually create one. Look in the supported technologies page to see what may produce transactions.
What Kafka broker version are you using?
What Kafka client version are you using?
If you set log_level to DEBUG, can you see some hints on what's traced and what's not?
No, monitoring Kafka with Elastic would include metrics and logs, but not APM.
From what I heard from the team, they are using kafka client
so from api-1 => kafka,
the trace from api-1 captures the expected trace which also shows kafka. However the trace stops here and does not link to api-2 when the traceparent header is enabled
we are using java agent 1.18 and to get transactions we are using the @CaptureTransaction annotation
Normally, you don't need to use @CaptureTransaction or anything else in order to get distributed tracing with Kafka. What happens if you remove any manual tracing from both services?
Do you see Kafka records reaching api-2 service with the traceparent header?
If the header is reaching api-2 and transactions don't get linked to the trace after removing any manual tracing, please provide debug log for api-2.
If records are reaching api-2 without the header, please provide debug log for api-1.
You may be able to understand what happens from the logs yourself.
at first our traces are not appearing with captureTransaction as we suspect most of the functions we wanted to trace are not http calls but internal local calls, adding captureTransaction to the local functions we want to trace will allow it to appear in kibana,
As for the log_level debug, where should I set this to begin debugging? Would it be in the APM level, or application level? Sorry I am new to debugging this tracing
i will check on the api-2 part and get back to you
Try removing the @CaptureTransaction from anything that can be on the Kafka receiver part (i.e. api-2).
I was referring to the APM Java agent log_level config. Either through properties file or central config as log_level, or through a System property called elastic.apm.log_level, or an env variable called ELASTIC_APM_LOG_LEVEL,
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.