AppDynamics Application Intelligence Platform
3.9.x Documentation
Web EUEM works in the following way:
onload
event for the page fires, a copy of a somewhat larger JavaScript file, the JavaScript agent extension, is downloaded from AWS asynchronously by the injected agent.To instrument your application for Web EUEM you must set up your web application to insert the JavaScript agent file into the page that is returned to the end user as part of the normal process it follows. The act of inserting the agent is called injection.
There are several ways to inject the JavaScript agent for Web EUEM into your web pages.
Not all types of injection are supported on all frameworks and platforms. See the Script Injection columns in the Supported Platform Matrix for Web EUEM matrices to find out what types are supported for your application.
Manual injection is supported on all platforms and frameworks. To set up a manually injected page, you:
Manually configure each page you wish to instrument to find the script where you stored it so that it can be executed as the page is constructed by the browser.
You can also choose to point your page to an AppDynamics hosted version of the JavaScript agent instead of hosting it locally. See Options in Using Manual Injection for the EUEM JavaScript Agent for more information.
For detailed instructions on using manual injection in your application, see Manual Injection.
If you are using a Java or .Net app agent on the server-side, and your application is running in an environment that supports the Apache Jasper JSP compiler (for Java) or ASP.NET or ASPX (for .NET), you may be able to use automatic injection, where the server-side app agent completely manages injecting the code at runtime. For detailed instructions on using automatic injection in your application, see Automatic Injection.
Assisted injection is available in two variants. In both cases some of the work is done manually by you and some of the work is done by the server-side Java or .Net app agent.
In this type of assisted injection you configure rules that define which app server Java classes and methods write to the output stream of your application and the writer object that is used to do that writing. AppDynamics intercepts the method and injects the JavaScript agent into the output stream. You also specify which business transactions you wish to have instrumented in this way.
For detailed information on using this form of assisted injection, see Assisted Injection-Using Injection Rules - Java Only.
In this type of assisted injection you copy small code snippets appropriate to your framework into your page templates or other code that creates your pages. This snippet contains two variables, JS_HEADER and JS_FOOTER, which the app agent replaces with the appropriate information in the response object at runtime.
For detailed information on using this form of assisted injection, see Assisted Injection-Using Attribute Injection.
If you are uncertain which procedure to use to inject the agent into your web pages, follow these guidelines, in this order:
Automatic injection requires the least amount of effort because you do not have to manually instrument every page. Check the matrices at End User Monitoring (EUEM) Compatibility to see if automatic injection has been tested in your environment. Also see Automatic Injection.
Once the agent is injected, it can take the AppDynamic controller a few minutes to discover and recognize the page, which must happen before data will begin to appear. If, however, you have configured your page using manual injection and are not seeing EUEM metrics after running load for a while, check the web page to confirm that the JavaScript Agent for EUEM is present in the page. If it is not, try injecting the script again.
If after two attempts you still do not see EUEM metrics, try one of the other injection schemes if they are available for your platform, or call AppDynamics Support.
If you try one way to inject and it does not work, AppDynamics recommends that you undo the current injection configuration before implementing another one.
If multiple copies of the agent exist on a page, the second copy does not execute.
To get the full real execution time for correlated business transactions your injection method must write the JS_FOOTER data variable to your page. Manual injection gives the server-side agent the ability to write data only to the header of the page as it is being constructed by your web application. It is possible that complete business-transaction timing information is not available at the moment that the header data is written. Using the footer allows the server-side agent to write timing data at the footer of the page, by which time a fuller picture of business transaction timing is available.
You can write the JS_FOOTER data variable into the footer of a web page using the following techniques:
If you cannot add the JS_FOOTER variable to your page, the timing shown for correlated business transactions is the average response time for that transaction rather than the real execution time for that specific page.