• EnglishEspañol日本語한국어Português
  • Log inStart now

Disable Scala, Netty, Akka, and Play 2 Instrumentation

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
enabled: false
enabled: false
enabled: false
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
# Disable all Akka instrumentations
enabled: false
enabled: false
# Disabling 2.2 also disables higher versions
enabled: false
# Disable all Netty instrumentations
enabled: false
enabled: false
enabled: false
enabled: false
# Disable all Play 2 instrumentations
enabled: false
enabled: false
enabled: false
# New in Release 3.22, the Play 2.4 instrumentation does not respect
# the older play2_instrumentation configuration setting
enabled: false
# Disable all Scala-language instrumentations
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


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.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.