APM Agent language and version: java 1.18.1 (Manual setup with -javaagent flag)
We have plugged the java APM agent to our dropwizard application.
In this application we have a ContainerRequestFilter executed after the resource is matched that injects custom HTTP headers in the request (through ContainerRequestContext.getHeaders().add() method). They are perfectly passed on to our code that follows.
However we can't see these headers in the Transaction details view in Kibana (we only see the request headers sent by the client). Is that possible to see them without calling the java APM API in our code (we'd like to avoid including specific code)?
It appears that the transactions are created before your ContainerRequestFilter gets executed, which is why the headers added by it are not visible.
I'm afraid the public API is the way to go. I understand why you don't want to add such a dependency to your application. One thing I can suggest is adding another filter after the one that adds the headers, and use the API to add the new headers to the Transaction as labels. This way, you can isolate it from your application code (including your current filter code), so it is the only one with the API dependency. It worth to mention also that the API jar is noop as long as there is no APM agent attached, meaning - it will have no effect on your application whatsoever in the absence of the Java agent.
Thank you for your reply, we'll go for that option then.
However, we'll add the extra headers as labels, right? I don't see in the Transaction API a way to add headers.
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.