Use of Public API for Java application running on Jboss Server as an OSGi container

Hi,

I am really sorry, if these questions are too basic, but I am new to java and have no idea from where to start.

Below are the version I am using -

Kibana version: 7.7.0

Elasticsearch version: 7.7.0

APM Server version: 7.7.0

APM Agent language and version: 1.16

Browser version: Chrome 84.0

Original install method (e.g. download page, yum, deb, from source, etc.) and version: rpm

Fresh install or upgraded from other version? Fresh

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Below are the version I am using -

Fuse - jboss-fuse-6.3.0.redhat-329

ElasticSearch - 7.7.0

Kibana - 7.7.0

APM - 7.7.0

Servlet - Undertow

I want to use Public API for java application as JBOSS Fuse is not supported by APM. My application is running on Jboss Fuse as a part of OSGi Container. But I don't know how to proceed.
I have gone through this link -
https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html

But still I am having several doubts -

1 - What all jar file do I need to install ?

2 - Where to place those jar file ? If I have to add in pom.xml or anywhere else ?

3 - It's given to import co.elastic.apm.api.ElasticApm and co.elastic.apm.api.Transaction, so where to add package co.elastic.apm ?

4 - Do I need to add bootdelegation, if yes, then where ?

5 - Also, in the link, it says to use several API, but where to add those methods and how ?

6 - Where to pass flags like - path of jar, server_urls, log_level, service_name etc with javaagent. Do, we need to add it as JAVA_OPTS in our application.yml or pass it while running the build.

Is it possible to share any example where public API has been used.

Thanks,
Puja

Hi @puja, there are multiple things involved when you use public API:

  • you have to add the public api jar to your application dependencies, likely in your pom.xml
  • you have to setup the agent at runtime in your environment.

In order to have the manual instrumentation working, you need to successfully do the both, but each can be done separately and in any order.
I would suggest to start with doing agent setup first, then add the public API to you application. This will allow to check that metrics are being reported and visible in Kibana.