To use assisted injection of the JavaScript agent using injection rules, you define rules to configure: 

Assisted injection is available for Java frameworks only.

Access the JavaScript Injection Configuration Panel

  1. In the left navigation menu, click Configure -> Instrumentation.
  2. Click the End User Experience tab.
  3. Click the Web JavaScript Instrumentation tab if it is not already selected.
  4. Scroll down to the Advanced panel and expand it if it is closed.
  5. Expand Advanced Instrumentation of your HTML Pages if it is closed.
  6. Click the Configure JavaScript Injection tab if it is not already selected.

Create JavaScript Injection Rules

1. In the Configure JavaScript Injection tab, expand Create Injection Rules if it is closed.

2. Click the plus icon.
The Create Injection Rule screen is displayed. 

3. Click the Where to Inject JavaScript tab.

4. In the Name field, enter a name for the rule and check Enable to enable it.

6. In the Class and Method to intercept section, define match conditions for the class and method that write to the output stream in your application. This is the class that AppDynamics intercepts for injection.

7. If the write method is overloaded

a. check the Is this Method Overloaded? check box.
b. click Add Parameter.
c. add the parameters that define the method.

8. In the Pointer to the writer section, select how to obtain a reference to the writer object from the selected method.

9. In the Injection options section, specify:

Define Business Transactions to Instrument

Optionally you can limit the business transactions for which the rule is enabled. By default the rule is enabled for all business transactions. To enable it for specific business transactions only:

1. Click the Inject for these Business Transactions tab.

2. Select These Business Transactions.

3. Specify the business transactions for which the injection rule is enabled by moving them from the Other Business Transactions list to the Selected Business Transactions list.

4. Specify the business transactions for which the injection rule is disabled by moving them to (or leaving them in) the Other Business Transactions list.

Create the Rule

1.Click Create Injection rule.

2. Click Save

Learn More