AppDynamics Application Intelligence Platform

3.8.x Documentation



Release Notes

Skip to end of metadata
Go to start of metadata

In a Java environment background tasks are detected using POJO entry points. It is the same basic procedure as defining entry points for business transactions, except that you check the Background Task check box. For instructions see Configure Background Tasks.

Pre-Configured Frameworks for Java Background Tasks

When enabled, AppDynamics provides discovery for the following Java background-processing task frameworks:

  • Quartz
  • Cron4J
  • JCronTab
  • JavaTimer

Configure Background Tasks

Enabling Automatic Discovery for Background Tasks

Automatic discovery of background tasks is disabled by default. When you know that there are background tasks in your application environment and you want to monitor them, first enable automatic discovery so that AppDynamics will detect the task.

AppDynamics provides preconfigured support for some common frameworks. If your application is not using one of the default frameworks you can create a custom match rule.

To enable discovery for a background task using a common framework

1. In the left navigation pane, click Configure -> Instrumentation.

2. On the Transaction Detection tab, select the tier for which you want to enable monitoring.

3. Click Use Custom Configuration for this Tier.

4. Scroll down to the Custom Match Rules pane.

5. Do one of the following

  • If you are using a pre-configured framework, select the row of the framework and click the pencil icon, or double-click on the row to open the Business Transaction Match Rule window. By default the values are populated with rule name and the class and method names for the particular framework. Verify that those are the correct names for your environment.
  • If you are using a custom framework, select the match criteria and enter the Class Name and Method Name.

The Background Task check box should be already checked.

6. Check Enabled.

7. Click Save.

The custom match rule for the background task will take effect and the background task will display in the Business Transaction List.

Once you enable discovery, every background task is identified based on following attributes:

  • Implementation class name
  • Parameter to the execution method name

Configuring Background Batch or Shell Files using a Main Method

Sometimes background tasks are defined in batch or shell files in which the main method triggers the background processing. In this situation, the response time of the batch process is the duration of the execution of the main method.

(warning) IMPORTANT: Instrument the main method only when the duration of the batch process is equal to the duration of the main method. Otherwise choose another method that accurately represents the unit of work for the background process.

To instrument the main method of a background task

1. In the left navigation pane, click Configure -> Instrumentation.

2. In the Transaction Detection section select the tier for which you want to instrument the main method.

3. In the Custom Rules section click Add (the "+" icon).

4. From the Entry Point type drop down list, click POJO.

5. Enter a name for the custom rule.

6. Check Background Task.  

7. Check Enabled.

8. Enter "main" as the match value for Method Name.

9. Save the changes.

10. To ensure that the name of the script file is automatically picked up as a background task, configure your Java Agent for that node. See Configure App Agent for Java for Batch Processes.

Learn More