The Java agent is a fully-featured library that automatically collects data from many popular servers, frameworks, libraries, and datastores (for a full list, see Compatibility and requirements). It also has a significant feature set. However, there are always additional requests for functionality and instrumentation of new libraries. The Java agent provides extension modules for this purpose.
Extension modules fall into three general categories:
- Incubator instrumentation modules: Experimental new support to collect data from specific libraries
- Archived instrumentation modules: Instrumentation for libraries that the original company or author no longer maintains or updates.
- Feature extension modules: Code that adds new behavior to the agent, independent of any specific library.
If your library isn't covered by the automatic instrumentation or by an instrumentation module, you can still collect data with custom instrumentation.
If you have feedback, questions, or problems with this instrumentation, create a post in New Relic's Explorers Hub, and tag your post with java_incubator
.
Install extension modules
We recommend updating to the latest Java agent version before installing an extension module. To install an extension module:
- Download the appropriate
.jar
file from module lists below. - Locate the directory that contains your
newrelic.jar
andnewrelic.yml
files. In that directory, create a sub-directory namedextensions
(if there is not already one there). - Copy the
.jar
extension module you downloaded into theextensions
directory. - For Feature extension modules, update your
newrelic.yml
with feature-specific configuration. - Restart your server.
- Send some traffic to the server or host that will exercise the feature or instrumentation.
Java agent extension modules are subject to the New Relic Java agent licenses, which are included in each module jar's LICENSE
file.
Feature extension modules
Extension modules are additional libraries that add commonly-requested functionality.
To use the an extension module, download it and put it in the Extensions Directory.
- Class Histogram
-
Download link Download the module The Class Histogram extension runs jmap periodically and generates
ClassHistogramRowEvent
andClassHistogramStatsEvent
data that you can query and chart. Querying this data can be useful when troubleshooting memory leaks as you can see the values over time.You configure the Class Histogram extension the same way you configure the Java agent: using environment variables, system properties, or
newrelic.yml
. Here are available properties, with defaults:extensions: class_histogram: enabled: true # true is the default if the extension is present classes_per_histogram: 50 # 50 is the default, and memory leak issues are usually in the highest 50 classes by bytes jmap_path: /your/jdk/bin # The folder where the jmap binary lives. The default is $JAVA_HOME/bin. delay_between_calls_seconds: 60 # Length of the delay between executions to avoid frequent pauses
Incubator instrumentation modules
Incubator modules are experimental instrumentation, which we may build into the agent's automatic instrumentation in the future.
These are the incubator modules that are currently available:
- Apache Camel 2.12
-
Download link Download the module This instrumentation module intercepts the following:
org.apache.camel.component.http.CamelServlet.resolve
To name the transaction so that web transactions have a finer grained name than the Camel servlet name, it uses this:
org.apache.camel.component.http.HttpConsumer.getPath()
To view the bytecode, use this terminal command:
javap -verbose -cp camel-2.12-FILENAME.jar org.apache.camel.component.http.CamelServlet
- C3P0 database connection pools
-
Download link Download the module Java agent version 3.12.0 or higher This instrumentation module samples C3P0 connection pools and reports busy and idle counts in metrics that start with this:
Custom/Database Connection/C3P0/METRIC_NAME
You can view the metrics with the metric explorer.
- Coda Hale's Metrics 2
-
Download link Download the module This instrumentation module integrates with the
MetricRegistry
and begins sampling the registered metrics every minute. Reported metrics are prefixed with this:Custom/CodaHale/Metrics2/METRIC_NAME
You can view the metrics with the metric explorer.
- Coda Hale's Metrics 3
-
Download link Download the module This instrumentation module integrates with the
MetricRegistry
and begins sampling the registered metrics every minute. Reported metrics are prefixed with this:Custom/CodaHale/Metrics3/METRIC_NAME
You can view the metrics with the metric explorer.
- HikariCP 2.3.0 - 2.3.8
-
Download link Download the module Java agent version 3.12.0 or higher This instrumentation module samples HikariCP database connection pools and reports busy and idle counts in metrics that start with this:
Custom/Database Connection/HikariCP/METRIC_NAME
You can view the metrics with the metric explorer.
- HikariCP 2.4.0 or higher
-
Download link Download the module Java agent version 3.12.0 or higher This instrumentation module samples HikariCP database connection pools and reports busy and idle counts in metrics that start with this:
Custom/Database Connection/HikariCP/METRIC_NAME
You can view the metrics with the metric explorer.
- Lettuce 4.0 - 5.0
-
Download link Download the module Java agent version 5.8.0 or higher - Lettuce 5.0 or higher
-
Download link Download the module Java agent version 5.8.0 or higher This instrumentation package instruments the Lettuce 5.x Redis driver. It enables calls to Redis to show up as datastore calls.
- Ratpack 1.4.0 or higher
-
Download link Download the module Java agent version 3.29 or higher This instrumentation module adds support for async linking of Ratpack's execution primitives. It also monitors handler execution. You must name the transactions manually by using the Java agent API.
- Ratpack Http Client 1.4.0 or higher
-
Download link Download the module This instrumentation captures Ratpack's HTTP client requests and responses.
Archived instrumentation modules
Archived modules are instrumentation for libraries that are no longer maintained by the original company or author. Because the target library isn't being updated, our support for archived modules has designated end dates.
These are the archived modules that are currently available:
- Akka [2.0]
-
Download link Download the module Java agent version 3.22.1 or higher Support ends on December 2019 This module provides link instrumentation between actors that send and receive messages. It also traces messages broadcast by or forwarded to actors. In order to avoid over-instrumentation, this instrumentation does not start transactions. If you would like a given actor call to mark the beginning of a transaction, use the
@Trace(dispatcher=true)
annotation, or some other form of custom instrumentation. - Akka [2.1]
-
Download link Download the module Java agent version 3.22.1 or higher Support ends on December 2019 This module provides link instrumentation between actors that send and receive messages. It also traces messages broadcast by or forwarded to actors. In order to avoid over-instrumentation, this instrumentation does not start transactions. If you would like a given actor call to mark the beginning of a transaction, use the
@Trace(dispatcher=true)
annotation, or some other form of custom instrumentation. - Akka HTTP [1.0]
-
Download link Download the module Java agent version 3.24.1 or higher Support ends on December 2019 This module creates transactions from Akka HTTP calls. It also instruments hand-offs between Akka actors, and calls from Akka to other databases and services.
For calling systems, this instrumentation collects cross application traces. If you're using a supported Akka version, you can view activity from your Akka HTTP apps from transactions all the way through your actor systems.
- Akka HTTP [2.0 – 2.4.1]
-
Download link Download the module Java agent version 3.24.1 or higher Support ends on December 2019 This module creates transactions from Akka HTTP calls. It also instruments hand-offs between Akka actors, and calls from Akka to other databases and services.
For calling systems, this instrumentation collects cross application traces. If you're using a supported Akka version, you can view activity from your Akka HTTP apps from transactions all the way through your actor systems.
- Akka HTTP [2.4.2 – 2.4.4]
-
Download link Download the module Java agent version 3.24.1 or higher Support ends on December 2019 This module creates transactions from Akka HTTP calls. It also instruments hand-offs between Akka actors, and calls from Akka to other databases and services.
For calling systems, this instrumentation collects cross application traces. You can use this instrumentation together with our built previously released support for Akka, to view activity from your Akka HTTP apps from transactions all the way through to your actor systems.
- Hystrix [1.0.2 – 1.1.7]
-
Download link Download the module Java agent version 3.23.0 or higher Support ends on December 2019 This module provides timing information related to each Hystrix command. The agent will link chained Hystrix commands into one transaction.
- Hystrix [1.2.0 – 1.2.18]
-
Download link Download the module Java agent version 3.23.0 or higher Support ends on December 2019 This module provides timing information related to each Hystrix command. The agent will link chained Hystrix commands into one transaction.
- Hystrix [1.3.0 – 1.3.13]
-
Download link Download the module Java agent version 3.23.0 or higher Support ends on December 2019 This module provides timing information related to each Hystrix command. The agent will link chained Hystrix commands into one transaction.
- Play [2.0]
-
Download link Download the module Java agent version 3.24.1 or higher Support ends on December 2019 This module creates and names transactions based on your Play controller classes.
- Play [2.1]
-
Download link Download the module Java agent version 3.24.1 or higher Support ends on December 2019 This module creates and names transactions based on your Play controller classes.
- Play [2.2]
-
Download link Download the module Java agent version 3.24.1 or higher Support ends on December 2019 This module creates and names transactions based on your Play controller classes.
- Solr [3.1.0 – 3.4.0]
-
Download link Download the module Java agent version 3.34.0 or higher Support ends on December 2019 This module instruments database calls to Solr servers, and collects detailed information about the Solr server itself. It also provides the database server and database name for the queries displayed in transaction traces and slow query traces.
- Solr [3.5.0]
-
Download link Download the module Java agent version 3.34.0 or higher Support ends on December 2019 This module instruments database calls to Solr servers, and collects detailed information about the Solr server itself. It also provides the database server and database name for the queries displayed in transaction traces and slow query traces.
- Solr [3.6.0 – 3.6.2]
-
Download link Download the module Java agent version 3.34.0 or higher Support ends on December 2019 This module instruments database calls to Solr servers, and collects detailed information about the Solr server itself. It also provides the database server and database name for the queries displayed in transaction traces and slow query traces.