Supported technologiesedit

The Elastic APM Java agent automatically instruments various APIs, frameworks and application servers. This section lists all supported technologies.

If your favorite technology is not supported yet, you can vote for it by participating in our survey. We will use the results to add support for the most requested technologies.

Another option is to add a dependency to the agent’s public API in order to programmatically create custom transactions and spans.

If you want to extend the auto-instrumentation capabilities of the agent, the contributing guide should get you started.

If, for example, the HTTP client library of your choice is not listed, it means that there won’t be spans for those outgoing HTTP requests. If the web framework you are using is not supported, the agent does not capture transactions.

Java versionsedit

VendorSupported versionsNotes

Oracle JDK

7, 8, 9, 10, 11

--module-path has not been tested yet

Open JDK

7, 8, 9, 10, 11

--module-path has not been tested yet

IBM J9 VM

8

 

Web Frameworksedit

FrameworkSupported versionsDescriptionSince

Servlet API

3+

A transaction will be created for all incoming HTTP requests to your Servlet API-based application. See also Application Servers/Servlet Containers

1.0.0

Spring Web MVC

4.x, 5.x

If you are using Spring MVC (for example with Spring Boot), the transactions are named based on your controllers (ControllerClass#controllerMethod).

1.0.0

JavaServer Faces

2.2.x, 2.3.x

If you are using JSF, transactions are named based on the requested Facelets and spans are captured for visibility into execution and rendering

1.0.0

Spring Boot

1.5+, 2.x

Supports embedded Tomcat, Jetty and Undertow

1.0.0

JAX-RS

2.x

The transactions are named based on your resources (ResourceClass#resourceMethod). Note that only the packages configured in application_packages are scanned for JAX-RS resources. If you don’t set this option, all classes are scanned. This comes at the cost of increased startup times, however.

Note: JAX-RS is only supported when running on a supported Application Server/Servlet Container.

1.0.0

JAX-WS

 

The transactions are named based on your @javax.jws.WebService annotated classes and @javax.jws.WebMethod annotated method names (WebServiceClass#webMethod). Note that only the packages configured in application_packages are scanned for JAX-WS resources. If you don’t set this option, all classes are scanned. This comes at the cost of increased startup times, however.

Note: JAX-WS is only supported when running on a supported Application Server/Servlet Container and when using the HTTP binding.

1.4.0

Application Servers/Servlet Containersedit

The Elastic APM Java agent has generic support for the Servlet API 3+. However, some servers require special handling. The servers listed here are tested by an integration test suite to make sure Elastic APM is compatible with them. Other Servlet 3+ compliant servers will most likely work as well.

ServerSupported versions

Tomcat

7.x, 8.5.x, 9.x

WildFly

8-16

JBoss EAP

6.4, 7.0, 7.1, 7.2

Jetty (only the ServletContextHandler is supported)

9.2, 9.3, 9.4

WebSphere Liberty

8.5.5, 18.0.x

Undertow Servlet

1.4

Payara

4.x, 5.x

Oracle WebLogic

12.2

Data Storesedit

DatabaseSupported versionsDescriptionSince

JDBC

4.1+

The agent automatically creates DB spans for all your JDBC queries. This includes JDBC queries executed by O/R mappers like Hibernate.

Note: Make sure that your JDBC driver is at least compiled for Java 1.5. For example, commons dbcp versions before 1.4 are not supported. IBM DB2 db2jcc drivers are also not supported. Please update to db2jcc4.

1.0.0

Elasticsearch

5.0.2+

The agent automatically creates Elasticsearch spans for queries done through the official REST client.

1.0.0, async queries since 1.5.0

Hibernate Search

5.x (on by default), 6.x (off by default)

The agent automatically creates Hibernate Search spans for queries done through the Hibernate Search API.

Note: this feature is marked as incubating for version 6.x, which means it is off by default. In order to enable, set the disable_instrumentations config option to an empty string

1.9.0

Redis Jedis

1.4.0-3.x

The agent creates spans for interactions with the Jedis client.

1.10.0

Networking frameworksedit

Distributed tracing will only work if you are using one of the supported networking frameworks.

For the supported HTTP libraries, the agent automatically creates spans for outgoing HTTP requests and propagates tracing headers. The spans are named after the schema <method> <host>, for example GET elastic.co.

FrameworkSupported versionsNoteSince

Apache HttpClient

4.3+

 

0.7.0

Apache HttpAsyncClient

4.0+

 

1.6.0

Spring RestTemplate

4+

 

0.7.0

OkHttp

2, 3

 

1.4.0 (synchronous calls via Call#execute()) 1.5.0 (async calls via Call#enquene(Callback))

HttpUrlConnection

  

1.4.0

JAX-WS client

 

JAX-WS clients created via javax.xml.ws.Service inherently support context propagation as they are using HttpUrlConnection underneath.

1.4.0

AsyncHttpClient

2.x

 

1.7.0

Asynchronous frameworksedit

When a Span is created in a different Thread than its parent, the trace context has to be propagated onto this thread.

This section lists all supported asynchronous frameworks.

FrameworkSupported versionsDescriptionSince

ExecutorService

 

The agent propagates the context when using the java.util.concurrent.ExecutorService methods of any ExecutorService implementation.

1.4.0

Messaging frameworksedit

When using a messaging framework, sender context is propagated so that receiver events are correlated to the same trace.

FrameworkSupported versionsDescriptionSince

JMS

1.1, 2.0

The agent captures JMS sends and receives as spans/transactions. In addition, it propagates the context when using javax.jms.MessageProducer#send and javax.jms.JMSProducer#send methods through a Message property. On receiver side, the agent reads the context from the Message property through javax.jms.MessageConsumer#receive, javax.jms.MessageConsumer#receiveNoWait, javax.jms.JMSConsumer#receive, javax.jms.JMSConsumer#receiveNoWait or javax.jms.MessageListener#onMessage and uses it for enabling distributed tracing.

1.7.0 - Incubating (off by default). In order to enable, set the disable_instrumentations config option to an empty string

Scheduling frameworksedit

When using a scheduling framework a transaction for every execution will be created.

FrameworkSupported versionsDescriptionSince

Scheduling Annotation

 

The agent instruments any method defined in a package configured in application_packages and annotated with one of the following: org.springframework.scheduling.annotation.Scheduled org.springframework.scheduling.annotation.Schedules javax.ejb.Schedule javax.ejb.Schedules in order to create a transaction with the type scheduled, representing the scheduled task execution

1.6.0

Quartz

 

The agent instruments the execute method of any class implementing org.quartz.Job, as well as the executeInternal method of any class extending org.springframework.scheduling.quartz.QuartzJobBean, and creates a transaction with the type scheduled, representing the job execution

NOTE: only classes from packages configured in application_packages will be instrumented.

1.8.0

Logging frameworksedit

FrameworkSupported versionsDescriptionSince

slf4j

1.4.1+

When enable_log_correlation is set to true, the agent will add a MDC entry for trace.id and transaction.id. See the enable_log_correlation configuration option for more details.

Automatically captures exceptions for logger.error("message", exception) calls (since 1.10.0)

1.0.0

Java method monitoringedit

If you are seeing gaps in the span timeline and want to include certain methods, there are several options:

StyleDescriptionAdvantagesDisadvantages

API/Code

Get the current span (possibly created by auto instrumentation) and create a child span. You can also use the OpenTracing API instead of the Elastic specific API.

This is the most flexible way: you can add labels to the span and customize the span type, name, and timestamp.

Wrong usage of the API may lead to invalid traces (scope leaks).

Annotations

Annotate any method with @CaptureSpan, @CaptureTransaction or @Traced.

Easier and more robust as there’s nothing you can do wrong like forgetting to end a span or close a scope. It’s also a bit more performant than the programmatic way.

Less flexible on it’s own but can be combined with the API. Just get the current span on an annotated method and customize the span to your liking.

Configuration

Use the trace_methods configuration option to specify additional methods to instrument.

You don’t need to modify the source code. That makes it possible to monitor code in 3rd party libraries. You can match methods via wildcards in the package, class or method name, by their modifier (like public), by a particular annotation, and more.

Easy to overuse by matching too many methods which hurts performance. Use together with trace_methods_duration_threshold if setting for entire packages instead of specific methods in order to reduce overhead and avoid having too many spans in the UI.

Metricsedit

FrameworkDescriptionSince

Built-in metrics

The agent sends various system, JVM, and application metrics. See the metrics documentation.

1.3.0

JMX

Set the configuration option capture_jmx_metrics in order to monitor any JMX metric.

1.11.0

Caveatsedit

  • Certain OSGi containers need the following configuration setting in case you see exceptions like java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/StatementInstrumentation: org.osgi.framework.bootdelegation=co.elastic.apm.agent.*
  • Other JVM languages, like Scala, Kotlin and Groovy have not been tested yet.
  • The agent does currently not support running on JVMs with an enabled SecurityManager. You may see exceptions like this: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getProtectionDomain"). Try to grant java.security.AllPermission to the agent.