Tanuki java wrapper - standalone java application

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text :slight_smile:

Kibana version: 7.1.1

Elasticsearch version: 7.1.1

APM Server version:7.1.1

APM Agent language and version: 1.7.0

Browser version: N/A

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

Fresh install or upgraded from other version? N/A

long story short..
we are using Tanuki java wrapper for starting of our Java 1.8 apps

if we use Tanuki java wrapper to instrumentalize Wildfly 15 it works OK but if we want to start standalone java application we see that it regeistered itself in APM but there is no transactions

i can only see CPU and Memory metrics

so, question is.. is there any reason why it doesn't work?
it is JDK 1.8.202

config of wrapper is:
######## Wrapper Java Properties #########
wrapper.java.command=java
set.JAVA_HOME=/opt/appp/java/java8/
wrapper.java.command=%JAVA_HOME%/bin/java
wrapper.java.command.loglevel=ERROR

####### Java Evironment ###########
set.OPCO=XXX
set.JARPATH=/opt/appp/%OPCO%/PE/lib
set.CONFIGPATH=/opt/appp/%OPCO%/PE/cfg
set.LOGPATH=/var/opt/appp/%OPCO%/log/PE

######## Java Classpath properties ########
wrapper.java.classpath.1=/opt/appp/wrapper/lib/wrapper.jar
wrapper.java.classpath.2=app.jar
wrapper.java.classpath.3=%JARPATH%/*.jar
wrapper.java.classpath.4=%CONFIGPATH%

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

wrapper.java.library.path.1=/opt/appp/wrapper/lib

######## Additional Properties#######
wrapper.java.additional.auto_bits=TRUE
wrapper.java.additional.1=-Xmx768m
wrapper.java.additional.2=-D[APPEE]
wrapper.java.additional.3=-Daxis.ClientConfigFile=%CONFIGPATH%/client-config.wsdd

wrapper.java.additional.30=-javaagent:/opt/appp/deploy/elastic-apm-agent.jar
wrapper.java.additional.31=-Delastic.apm.service_name=MyAPPEE
wrapper.java.additional.32=-Delastic.apm.application_packages=org.apache
wrapper.java.additional.33=-Delastic.apm.server_urls=http://11.11.11.11:8200
wrapper.java.additional.34=-Delastic.apm.capture_headers=true

wrapper.app.parameter.1=com.app.apppcee.pe.PEMain
wrapper.app.parameter.2=-start
wrapper.app.parameter.3=-config
wrapper.app.parameter.4=%CONFIGPATH%/Configuration.xml

update1: in logs i can see that apm agent successfully started:

wrapper.log:INFO | jvm 1 | 2019/06/21 15:28:46 | 2019-06-21 15:28:46.350 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.7.0 as MkaProvisioningEngine on Java 1.8.0_212 (Oracle Corporation) Linux 2.6.32-754.2.1.el6.x86_64
wrapper.log:INFO | jvm 1 | 2019/06/21 15:28:46 | 2019-06-21 15:28:46.369 [apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2019-05-23T12:59:32Z", "build_sha": "410bf33fa1b67fa5bd02a388de17d0e30ec031da", "version": "7.1.1"}
wrapper.log:INFO | jvm 1 | 2019/06/21 15:29:17 | 2019-06-21 15:29:17.748 [RequestProcessor-10] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - org.apache.commons.dbcp.PoolableConnection uses an unsupported class file version (pre Java 5) and can't be instrumented. Consider updating to a newer version of that library.

thanks
tomislav

Hi Tomislav, welcome to the forum :slight_smile:

We automatically trace servlet containers by instrumenting the Servlet API for Transaction creation.
Even if we instrument other stuff automatically (like JDBC or HTTP clients), we will not capture them unless they are executed within traced transactions.
This is why you get data for WildFly and not for your standalone app, where we have no way of identifying a proper location to start and end transactions.

Fortunately, we have a public API you can use in order to manually instrument and trace arbitrary Java apps. Through this API you can start/activate/deactivate/end Transactions, spans, capture errors and much more. Please go over it carefully - if you fully understand how to use it and maintain proper states of Spans and Transactions it can give you a lot of flexibility to get what you want.

I hope this helps,
Eyal.

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