APM and Jira

I'm in need to test the APM of Jira system. I deployed a fresh version of Jira and APM server.
I'm getting different variations of errors.
since Jira runs on Tomcat, I have placed in setenv.sh the following this guide.
https://www.elastic.co/guide/en/apm/agent/java/current/application-server-setup.html

export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/apm/elastic-apm-agent-1.0.1.jar"
export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.service_name=jira-test"
export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.application_packages=jira.test"
export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.server_urls=http://localhost:8300"

During startup, I see two exceptions related to apm.

2018-11-24 05:31:00,682 WaitForAO DEBUG [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] getService bundle [com.atlassian.jira.plugins.jira-dvcs-connector-plugin]
Exception in thread "WaitForAO" java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/ConnectionInstrumentation

and

2018-11-24 05:32:01,897 http-nio-8080-exec-1 ERROR [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: co/elastic/apm/jaxrs/JaxRsTransactionNameInstrumentation
java.lang.NoClassDefFoundError: co/elastic/apm/jaxrs/JaxRsTransactionNameInstrumentation

What does this mean and how do I resolve it so that the agent sends the data to the APM server?

APM sends the data to ES now that I have commented out this line in setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.server_urls=http://localhost:8300"

However, certain parts of jira isn't displaying correctly and correlating error in the catalina.out is

2018-11-24 06:33:08,052 http-nio-8080-exec-23 ERROR admin 393x201x1 rdefq9 10.24.1.202 /projects/PTSM/summary [c.a.p.webresource.assembler.DefaultWebResourceAssembler] Error generating bigpipe content for 'sidebar-id': com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/ConnectionInstrumentation
java.util.concurrent.CompletionException: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/ConnectionInstrumentation

Is there some settings in the agent that's blocking data?

Hi,

Thanks for you interest in APM and the Java agent.

If I recall correctly Jira uses an OSGI container on a custom Tomcat setup. This is a setup that we don't officially support. The problem you are seeing seems to be because the OSGi container does not allow access to the agent classes from certain places.

What the agent currently does to support other OSGi environments, such as WebSpere, is to set the system property org.osgi.framework.bootdelegation=co.elastic.apm.* . But that somehow does not work on Jira and we don't know the reason.

If you know of a similar setting for Jira, enabling it in a similar way could solve your problem.

1 Like

Ah... @AlvaroLobato Thank you for the insight.

edit* It'll be nice to have something for Jira, confluence, etc. as I've seen countless performance issues with atlassian suite from different organizations.

Seems like the correct property for atlassian products is atlassian.org.osgi.framework.bootdelegation. See https://confluence.atlassian.com/jirakb/using-javaagent-with-jira-790793295.html#UsingjavaagentwithJIRA-Resolution.

Could you confirm that this is working for you? Then we can merge this pull request which adds this property automatically.

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