This document describes how to disable Java agent instrumentation on these popular async frameworks:
- Scala
- Netty
- Akka
- Play 2
You may choose to disable some or all of this instrumentation if you find that the metrics reported aren't valuable to you, or if the instrumentation incurs more overhead than you would like. If you selectively disable some of the instrumentation, some segments of activity will not be reported and your total time will be understated.
Java agent versions 3.21 or lower
If you are using Java agent version 3.22 or lower, add the following to the class_transformer
section of your newrelic.yml settings:
# This section is for settings common to all environments.# Do not add anything above this next line.common: &default_settings
class_transformer: akka_instrumentation: enabled: false netty_instrumenation: enabled: false play2_instrumentation: enabled: false scala_instrumentation: enabled: false
Java agent versions 3.22 or higher
The older Scala, Netty, Akka, and Play 2 Framework instrumentation configuration names were deprecated in Java agent version 3.22. If you use Java agent 3.22 or higher, add the following to the class_transformer
section of your newrelic.yml settings:
common: &default_settings
class_transformer: # Disable all Akka instrumentations com.newrelic.instrumentation.akka-2.0: enabled: false com.newrelic.instrumentation.akka-2.1: enabled: false # Disabling 2.2 also disables higher versions com.newrelic.instrumentation.akka-2.2: enabled: false
# Disable all Netty instrumentations com.newrelic.instrumentation.netty-3.4: enabled: false com.newrelic.instrumentation.netty-3.8: enabled: false com.newrelic.instrumentation.netty-4.0.0: enabled: false com.newrelic.instrumentation.netty-4.0.8: enabled: false
# Disable all Play 2 instrumentations com.newrelic.instrumentation.play-2.1: enabled: false com.newrelic.instrumentation.play-2.2: enabled: false com.newrelic.instrumentation.play-2.3: enabled: false # New in Release 3.22, the Play 2.4 instrumentation does not respect # the older play2_instrumentation configuration setting com.newrelic.instrumentation.play-2.4: enabled: false
# Disable all Scala-language instrumentations com.newrelic.instrumentation.scala-2.9.3: enabled: false
The pre-3.22 instrumentation names will be respected for a time, but they will be removed in future releases. If disabled by either the old or new instrumentation configuration, the instrumentation will be disabled.
Check for deprecated configuration settings
Any use of the pre-3.22 instrumentation names will be logged with messages similar to:
INFO: Using deprecated configuration setting akka_instrumentation for instrumentation com.newrelic.instrumentation.akka-2.2
OR
INFO: The configuration setting akka_instrumentation is deprecated, please update the class_transformer config to use com.newrelic.instrumentation.akka-2.2 instead
Using the deprecated settings does not indicate the deprecated instrumentation has been loaded or is being used. These messages are hints to the user that it is time to update your configuration settings.
Play 2.4 does not respect the older play2_instrumentation
configuration settings, as it is a new instrumentation. In all cases, if you are using Java agent version 3.22 or higher, you should use the new instrumentation names for the Scala, Netty, Akka, and Play 2 framework in their newrelic.yml.