このドキュメントでは、これらの一般的な非同期フレームワークでJavaエージェントのインスツルメンテーションを無効にする方法について説明します。
- Scala
- Netty
- Akka
- プレイ2
報告されるメトリクスに価値がないと判断した場合や、計測機器が必要以上にオーバーヘッドを発生させている場合は、この計測機器の一部または全部を無効にすることができます。一部の機器を選択的に無効にした場合、アクティビティの一部が報告されず、合計時間が少なくなります。
Javaエージェントバージョン3.21以下
Javaagent バージョン 3.22 以下を使用している場合は、 newrelic.yml設定のclass_transformerセクションに以下を追加します。
# 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: falseJavaエージェントバージョン3.22以上
古い Scala、Netty、Akka、Play 2 フレームワーク インストゥルメンテーション 設定 名は、Java エージェント バージョン 3.22 で非推奨になりました。 Javaagent 3.22 以降を使用する場合は、 newrelic.yml設定のclass_transformerセクションに以下を追加します。
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: false3.22以前のインストゥルメンテーション名はしばらくの間尊重されますが、将来のリリースでは削除されます。新旧どちらのインスツルメンテーション設定でも、無効になっている場合は
非推奨のコンフィグレーション設定のチェック
3.22以前のインストゥルメンテーション名を使用した場合は、以下のようなメッセージが記録されます。
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非推奨の設定を使用しても、非推奨の計測器がロードされたり、使用されているわけではありません。これらのメッセージは、コンフィギュレーション設定を更新する時期であることを示すヒントです。
Play 2.4 は新しいインストルメンテーションであるため、古いplay2_instrumentation構成設定を尊重しません。どのような場合でも、バージョン 3.22 以降の Java エージェントを使用している場合は、Scala、Netty、Akka、および Play 2 フレームワークの新しいインストルメンテーション名を newrelic.yml で使用する必要があります。