• /
  • ログイン
  • 無料アカウント

Instrument browser monitoring with Java agent API

Browser monitoring gives you visibility into how your users are interacting with your Java application by using a JavaScript snippet (or "agent") to instrument your app's webpages. To enable browser monitoring in our user interface, follow the procedures to install the Browser agent. For example, you can:

  • Enable an APM-monitored app.
  • Enable with the copy/paste method.
  • Enable by using the REST API.

You can also manually instrument your webpages by using the Java agent API, as explained in this document.

Use Java agent API

If your framework does not allow you to enable browser monitoring from our UI, with the copy/paste method, or by using our REST API, you can manually instrument monitoring for your webpages. To do this, use our Java agent API.

  1. Make sure you are using the latest Java agent version.

  2. Disable auto-instrumentation.

  3. Access the Java agent API class by adding newrelic-api.jar to your application class path.

  4. Add the appropriate method to start time tracking, for example: com.newrelic.api.agent.NewRelic.getBrowserTimingHeader().

    Add the appropriate method to stop time tracking, for example: com.newrelic.api.agent.NewRelic.getBrowserTimingFooter().

    Find the appropriate methods based on the framework you are using:

  5. Check the log file to verify that the agent is instrumenting correctly. Set the log_level setting in newrelic.yml to log_level: finer and check for the following messages:

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.