Releases

# Elastic APM Java Agent Beta Released

We are proud to announce the beta release of the Elastic APM Java agent! Before you get too excited, a quick reminder that you should not run the beta in production. But the agent is now ready for more serious testing, so you should definitely consider giving it a try in your test and dev environments. If you do so, we'd be thrilled to get some feedback in the discussion forum.

Elastic APM is an Application Performance Monitoring solution from Elastic and alongside the Java agent, there are official agents available for Node.js, Python, Ruby, JavaScript/RUM (beta), and Go (beta). Elastic APM helps you to gain insight into the performance of your application and tracks errors.

## Instrumenting a Spring Boot application

This section showcases how to instrument a Spring Boot application with the Elastic APM Java agent. Currently, we support Spring Boot 1.5.x-2.x as well as various application servers and servlet containers like WildFly and Tomcat. Note that it does not yet support Spring Boot Web Reactive. See the documentation for a list of all supported technologies.

The first step is to set up the backend for Elastic APM. You can find a detailed description about that in our getting started documentation.

The next step is to download the latest agent jar from Maven Central. Then, build your Spring Boot application just like you always to do get an executable jar file. When starting the application, add the -javaagent flag and define some system properties to configure the agent:

java -javaagent:/path/to/elastic-apm-agent-<version>.jar \
-Delastic.apm.server_url=http://localhost:8200 \
-Delastic.apm.service_name=my-application \
-Delastic.apm.application_packages=org.example \
-jar my-spring-boot-application.jar

For the curious, you can take a look at the agent documentation to learn about other configuration options and configuration sources, such as property files and environment variables.

Note that you can't declare a dependency to the agent in your pom.xml. The jar is only meant to be used in combination with the -javaagent flag. The beauty of this approach is that it's completely separate from the development and can be done during the deployment.

Nevertheless, we also provide an API for developers to customize transactions created by the agent's auto instrumentation or to create integrations for frameworks the agent does not (yet) know about. This combines the best of the two worlds of auto instrumentation where you don't have to do any code changes, with programmatic tracing and the ability to attach your application-specific metadata to the transactions. If you have already invested in OpenTracing or don't want to tie yourself to the Elastic APM API, we also offer an OpenTracing bridge.

## What it Does

The agent instruments your application to record all incoming Servlet API-based HTTP traffic and JDBC queries (that includes O/R mappers like Hibernate btw.). This information is sent to the APM server, which then indexes the data as documents inside Elasticsearch.

To view the data, you can use the APM UI inside Kibana, which is already included in the default distribution of Kibana (as of version 6.3). The APM UI offers a curated experience for the tracing data and allows you to drill down to specific HTTP requests and JDBC queries. You can also leverage the APM dashboards and visualizations, and mix and match with your existing dashboards.