Customizes fields send by the APM

Hello,

I'm trying to add fields about the thread to the default fields sent by the APM.

I want to know is it possible or not, if so how to do it ?

Thank you

Hi,

Which agent do you use? In the Java agent it is possible to add any data using addTag: https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-transaction-add-tag

Best regards
Wolfram

Thank you for your answer Wolfram,
At the moment i am trying to collect data about threads launched by an application deployed on jboss, do you have an idea how to proceed ?

The only way I know is:

  1. Include the apm-agent-api dependency to your application : https://mvnrepository.com/artifact/co.elastic.apm/apm-agent-api/1.4.0
  2. In your code access the current transaction: https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-current-transaction
  3. Add your custom fields: https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-transaction-add-tag

This might look like: ElasticApm.currentTransaction().addTag("isDaemon", Boolean.toString(Thread.currentThread().isDaemon()));

Hope this helps...

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.