Troubleshoot End User Monitoring

If you run into problems while using End User Monitoring (EUM), here are some tips to troubleshoot the issues.

EUM Data not Appearing in the APM UI

If the EUM data is not appearing in the APM UI, follow these steps to ensure that the data is getting collected.

  1. Check Injection Type.

    • Check if you have enabled Javascript injection for the APM Agent. Starting with Oracle Management Cloud 1.21, the default injection type is Correlation — which means that Javascript does not get injected automatically to every page, but agents have to be actively configured to perform Javascript injection. To change the injection type, see Enable and Configure End User Monitoring.

    • Alternatively, ensure that the Javascript is manually added to the required application pages. See Monitor End User Performance with Manual Browser Injection.

      Select Reference as the Injection Type.
  2. Check if Javascript is injected.

    • After checking the injection type as listed above, check if the Javascript is getting injected into the application pages.

    • If the EUM data is still not appearing, check the HTML source of the application page that should be monitored, to validate that the Javascript is present. In Firefox and Chrome, right click on the page, and select View Page Source. In Internet Explorer, right click and select View Source.

    • In the HTML source, search for the string baseCollectorUrl. If you cannot locate the string, then the Javascript is not correctly injected. This could be because of any of these factors:

      • EUM JavaScript will be injected by APM agents only if the Injection Type is configured for Full or Reference mode. For further information see, Enabling and Configuring End User Monitoring. If you prefer manual instrumentation of application pages, then leave Injection Type configured as Correlation. See Monitoring End User Performance through Manual Browser Injection for details.

      • If Javascript does not appear in the application pages once APM agents are configured as described above, then verify that the APM agents are deployed to all application servers delivering application pages.

    • For static HTML pages, make sure that the pages cached via content delivery networks (CDN) or content management systems are refreshed.

    • If the Javascript was manually injected, ensure that all the application pages are properly instrumented, by ensuring that the Javascript is identical with the Javascript snippet shown in the Oracle Application Performance Monitoring UI. (In the UI, click APM Admin, and select Browser Agent.)

      <script>
         window.apmeum || (apmeum = {});
         apmeum.customerId='<tenant id>';
         apmeum.baseCollectorUrl='https://<tenant id>.<data center specific>.oraclecloud.com/APMaaSCollector/external/collector?';
         </script>
         <script async src="https://<tenant id>.<data center specific>.oraclecloud.com/APMaaSCollector/external/collector/staticlib/apmeum.js"></script>
    • If Javascript is correctly injected, but the EUM data is still not visible, then proceed to check for issues with collector  availability, as described below.

    • If manual injection is used for an application where the back-end is monitored by APM Agents, and there are no server requests shown for pages and Ajax calls, then check if agents are configured for injection type correlation. This is required for pages and Ajax calls to be associated with server requests.

  3. Is the collector Javascript downloaded and executed?

    • By default, the Javascript will be downloaded from the collector location https://<tenant id>.<data center specific>.oraclecloud.com/APMaaSCollector/external/collector/staticlib/apmeum.js.

      Some sites have additional protection against remote hosted Javascript to prevent cross-site-scripting. In this scenario, copy the script and host it locally. Configure the oracle.apmaas.agent.jsLibraryUrl setting in the apmagent properties file.

      Edit the apmagent properties file, and add the location of the locally hosted apmeum.js file:
      oracle.apmaas.agent.jsLibraryUrl=https://<www.example.com>/apmStaticJS/apmeum.js))
    • Usually, browsers report blocked Javascript executions in the web console as a warning. Check the web console to spot the issue. See more information on the internet about Content Security Policy. For example you can search for Content Security Policy (CSP) in Mozilla Developer Network.

  4. Is the collector reachable?

    • Ensure that the EUM events are being sent to the ApmClientCollector. This is a pre-requisite for the EUM data to be displayed in the APM UI. You can check this by starting the Developer Console.

    • In most browsers, you can start the Developer Console by pressing the F12 key, and selecting the Network tab.

    • In the Network tab, load or reload one of the application pages to be monitored by APM. The requests shown should now contain requests to the collector.

      Example: https://<tenant>.<data center specific>.oraclecloud.com/APMaaSCollector/external/collector

    • If you don't see a 200 or 204 HTTP response code for requests to the collector, then that browser isn't able to access the collector. This could be caused by network configuration that limits internet access. When the internet access for users is limited, a reverse proxy may have to be set up inside the network to allow EUM events to be sent to Oracle Management Cloud. See Transferring EUM Data to OMC Collectors.

    • In some cases, the CSP policy blocks interaction with collector, and is usually reported in the web console as warnings.

  5. Static content is not monitored by default.

    Server requests for pages that are considered as static content are not monitored by default. File types considered as static content are the following: ".bmp", ".css", ".png", ".swz", ".jar", ".htm", ".html", ".dtd", ".mpeg", ".jpg", ".dat", ".mpg", ".mid", ".properties", ".js", ".ico", ".class", ".tif", ".gif", ".jpeg", ".swf", ".cur", ".woff".

    To change this configuration, see Monitoring a Web Application through Servlet Monitoring.

Browser Agent Interfering with the Monitored Application

Sometimes, enabling EUM can interfere with the smooth functioning of your application.

If Javascript is available in HTML pages as described above, and EUM metrics are visible in the APM UI, but instrumentation results in issues with functionality of the monitored application, try these tips:

  • For manual injection, check where the Javascript is placed. The script should be placed directly after the closing </head>tag or at the very end of the page. Ensure that it is not placed within another <script> tag.

  • When the Javascript is interfering with specific pages only, then turn off the Javascript injection for affected pages.

    To disable Javascript injection for a specific URL pattern (Example: /test/mysample):
    1. Edit apmagent/conf/BrowserAgent.json

    2. Add the following section. The change will be effective after about 30 seconds, without a restart of the application server.

      "urlConfigs": [
          {
              "patternString" : "/test/mysample",
              "config" : {
                  "extensionGroup" : "default",
                  "patternMatching" : [{
                      "patternString" : "/test/mysample",
                      "excluded" : true,
                      "includeQueryString": false
                  }]
              }
          }
      ]

In some cases the interaction between the APM Javascript and the application’s Javascript causes problems. On Internet Explorer, you can resolve this by disabling the tracking of particular events from the browser.

Edit the apmagent properties file by adding the browser setting property:
oracle.apmaas.agent.browser.setting=ie(ajax:off, click:off)

Validating Customizations

You can customize the data that your application sends to Oracle Management Cloud. Validate the customization you’ve done through these steps:

Validating apmeum object:

After you have added the customization code, the apmeum object will be updated. Use the developer tools of your browser to validate the contents of the username property. The below verification is applicable to most of the browsers.

Verify username property across multiple browsers:

To validate the username property, in the developer tools window of your browser, enter:
window.apmeum.username
If the customization code has not been updated correctly, you will see the following message:
window.apmeum.username
undefined
If the customization code has been updated correctly, the user name is displayed as below:
window.apmeum.username
<username>

Validating information sent to Oracle Management Cloud

The information from apmeum object and the metrics are combined into messages that are sent to the apm collector in Oracle Management Cloud. This is visible in browsers by requests that are made to /APMaaSCollector/external/collector URLs.

You can view this information in the Network tab of the Developer Tools in most browsers. To validate, check the request body to ensure that the specific test is listed. You can also filter the URLs to view only the relevant ones.