APMブラウザ・エージェント・インジェクションの有効化
事前設定
-
APMドメインの作成時に生成されるパブリック・データ・キーを取得する必要があります。
公開データ・キーは、次の方法で取得できます。
- ナビゲーション・メニューを開き、「監視および管理」をクリックします。「Application Performance Monitoring」で、「管理」をクリックします。
「管理」ページで、目的のコンパートメントおよびAPMドメインを選択します。
-
「リソース」の下にある「データ・キー」をクリックして、データ・キーをリストします。
データ・キーが存在しない場合は、「データ・キーの生成」をクリックし、「パブリック・データ・キー」を選択します。
-
「コピー」をクリックします。これは、「公開」タイプのデータ・キーの隣にあります。この値は後で使用します。
詳細は、データ・アップロード・エンドポイントおよびデータ・キーの取得を参照してください。
- ナビゲーション・メニューを開き、「監視および管理」をクリックします。「Application Performance Monitoring」で、「管理」をクリックします。
インストーラ経由で有効化
APMエージェント・バージョン1.6以降では、-enable-browser-agent-injection
オプションを使用してエージェントをプロビジョニングするときにAPMブラウザ・エージェント・インジェクションを有効にできます。
例:
java -jar apm-java-agent-installer-1.6 provision-agent -destination=/example/path/destination -service-name=example_apm_service -private-data-key=ExamplePrivateDataKey -data-upload-endpoint=https://dataUploadEndpoint.com -enable-browser-agent-injection -public-data-key=ExamplePublicDataKey
ここで、ExamplePublicDataKeyは、前提条件のステップ3でOCIコンソールから取得した公開データ・キーに置き換えられます。
Javaエージェントは、起動時にブラウザ・エージェント・インジェクションを実行するように自動的に構成されます。
エージェントをプロビジョニングするときにヘルプ情報を表示するには、-help
オプションを使用します。例:
java -jar ./apm-java-agent-installer-<version>.jar provision-agent -help
Usage:
apm-java-agent-installer-<version>.jar provision-agent [options ...]
options:
...
...
-enable-browser-agent-injection
Enables the APM Agent to automatically inject the browser agent into HTML
pages. Make sure '-public-data-key' is also set, otherwise injection will
not be enabled until one is provided.
-public-data-key=<public_data_key>
APM Agent public data key for Appserver Agents. This property is required
for the injected browser agent to connect to the Oracle APM Cloud, and it
is specific to your APM Cloud Domain.
...
...
オプションの詳細は、ヘルプの使用方法情報を参照してください。
AgentConfig.properties
ファイルを使用して有効化
古いAPMエージェント・バージョンからアップグレードする場合、またはインストーラを介してブラウザ・エージェント・インジェクションを有効にしなかった場合は、エージェントのアップグレードまたはインストールの実行後に、この機能を手動で有効にする必要があります。
-
既存の
oracle-apm-agent/config
ディレクトリに移動します。そこから、アップグレードした最新バージョンのディレクトリに移動します。 -
AgentConfig.properties
ファイルを開き、次の2つのプロパティを更新します。ノート
コメントを外して(#
記号を削除する必要があります)、更新する必要があります。- com.oracle.apm.agent.rum.enable.injection: このプロパティの
#
を削除し、値をtrue
に設定します - com.oracle.apm.agent.public.data.key: このプロパティの
#
を削除し、前の前提条件中にステップ3から取得した公開データ・キーに値を設定します。
プロパティが更新されると、ファイルは次のようになります。# APM Agent public data key. This property is required for the injected Browser Agent to connect to server, which can be # obtained at APM service sign up. # ... ... ... #--------------------------- Start of Browser Agent (RUM) Injection Properties--------------------------------------- # Enables browser agent injection. # Once enabled, the agent will inject a few lines of JavaScript code into the HTTP pages served by this AppServer. # It is recommended to test the application and exclude any pages that may be adversely affected by this injection. # See "Configure APM Browser Agent Injection using APM Java Agent" in the service documentation for more details. com.oracle.apm.agent.rum.enable.injection=true # APM Agent public data key. This property is required for the injected Browser Agent to connect to server, which can be # obtained at APM service sign up. com.oracle.apm.agent.public.data.key=ExamplePublicDataKey
- com.oracle.apm.agent.rum.enable.injection: このプロパティの
APM Javaエージェントは、APMブラウザ・エージェント・インジェクションの実行を開始するように構成され、ページロード時間、DNS時間、SSL時間などの実際のユーザー・メトリックに関する詳細なインサイトを収集できます。