Java User Experience sensor

Note

This sensor does not support OneAgent.

The User Experience sensor allows you to see how your applications are doing with the real users. It injects JavaScript Agent to your web pages, and collects timing and action information about user visit.

Sensor configuration

To edit the System Profile specific settings, right click you System Profile, and select Edit System Profile > Agent Group/tier > Sensor Configuration and then select the User Experience item in the Sensor Configuration list.

  • Inject manually: JavaScript Agent tag is not injected into HTML responses, AppMon Monitor beacon is not handled. Use this if you put the JavaScript Agent tag manually in your HTML code.
  • Automatically inject JavaScript agent into HTML: JavaScript Agent tag is automatically injected into HTML responses. See JavaScript Agent for auto-injection rules.

JS Tag Example

 ...
<head>
...
<script
   type="text/javascript"
   src="/dtagent55_jnps_5191.js"
   data dtconfig="rid=RID_-1381208364|
   rpid=15233675|sffs|domain=mydomain.com">
</script>
<script type="text/javascript">
    var contextPath = '/community';
</script>

When you use this sensor on a Java application server, you can optimize the servlet filter chain injection point using the following options:

  • Inject before outermost HttpServletResponse: Injection works in most cases, but it may not work if one of the servlet filters compresses the HTML response body. In this case, the Java Agent wraps the HttpServletResponse object passed to the outermost servlet filter.
  • Inject before innermost HttpServletResponse: Injection works in most cases, but it may not work if one of the servlet filters parses the HTML and removes the script tag previously injected by the Java Agent. In this case, the Java Agent wraps the HttpServletResponse object passed to the outermost servlet filter and wraps again whenever some other servlet filter wraps our own object.
  • Inject in a specific servlet or filter: Use this option as a fallback when none of the automatic options work for all requests. In this case, the Java Agent only wraps the response in the specified filter or servlet.
  • URI-specific injection behavior: If the auto-injection rules place the JavaScript agent tag in a place unsuitable for your application, you can fine-tune it by setting some URI-specific injection behavior rules as exceptions to the auto-injection rules.
    • Condition and URI pattern specifies any conditions or URI patterns to use for filtering. For example, you specify that the rule should only apply to pages starting with /community/display. Wildcards like * or ? are not supported, but for matching any URI you could use contains /.
    • Injection Rule and HTML pattern specify the desired injection behavior:
      • automatic: The default behavior. The JavaScript Agent injects automatically as first of script tag in <head> at delivery of the web page
      • do not inject on this agent: Equivalent setting the Injection Point to off. Agents matching other agent groups may take over and perform an injection themselves.
      • before specific HTML: Inject before a specific piece of HTML source code known to occur in the page, such as <link rel="icon" type="image/png" href="/s/620/3/_/images/common-icons/favicon.png">. Specify the code in the HTML pattern field. You can just paste any piece of your HTML source code.
      • after specific HTML: Inject after a specific piece of HTML source code known to occur in the page, such as <BASE HREF="[https://www.example.com/approot/](https://www.example.com/approot/)"> Specify the code in the HTML pattern field. You can just paste any piece of your HTML source code.
      • do not inject on this and subsequent agents: Same as do not inject on this agent, plus this rule prevents sensor properties set on other (outermore) agents from overriding this choice and performing the injection there.

Notes

For rules other than before specific HTML and after specific HTML the contents of the HTML pattern column is ignored. The rule list is evaluated top-down, so that if a page matches multiple URI-specific rules, the topmost rule is applied.

The after specific HTML rule provides a slightly better performance than the before specific HTML rule.

  • Send compressed JavaScript Agent to browser: To keep the network overhead low, the Agent sends the file compressed. Clear the Send compressed JavaScript Agent to browser check box if your web server or any front tier, such as a load balancer, compresses the outgoing content. This prevents it from being compressed twice and lowers the CPU usage on that tier.