Help Docs

Context-based monitoring for Java applications

Let's say your application server has three Java applications running on it. 

By default, transactions of all applications coming from the same app server are shown collectively under the Web Transactions tab in APM Insight.

In the image cited below, ZYLKER is the application monitor name, and travel,cafe and tourism are three contexts running on the same application server.

The transactions of these three applications are listed out in the Web Transaction tab.

 

 

Now, with context-based monitoring, you can monitor the performance of all individual applications running in the same app server separately, which helps you analyze your application performance at a more granular level.

This means that by enabling context-based monitoring, transactions of travels, tourism and cafe can be viewed separately.

 

 

Read on to know 

How to enable context-based monitoring

  1. Log in to Site24x7.
  2. Download and install the APM Insight Java agent if you haven't already.
  3. Add the following key in the apminsight.conf file
    • "context.monitoring.enabled=true"
  4. Restart the server.
  5. Perform some transactions in respective contexts for the agent to identify them as individual monitors.

Note:  Each context name is prefixed with the application name provided in the configuration file.

Example: If the application name provided in the configuration file is ZYLKER, and individual context names are tourism, cafe, and travels, then the individual contexts will be shown in the APM Insight client as shown below:

ZYLKER/Tourism

ZYLKER/Cafe

ZYLKER/Travels

Note

If context-based monitoring is enabled, each individual context is considered a separate APM application, and each context consumes an advanced monitor license.

How to rename or group context names

  To rename your contexts:

  1. Navigate to the APM Insight agent directory.
  2. Create a file named:
    • "context_naming_patterns_conf"
  3. Provide a key-value pair, with the syntax key=value, wherein:
    • Key denotes the exact context name or regex matching the context names.
    • Value denotes the name used to rename the context.

Example

  1. When you want to change your context name from sampleapp to jpetstore, provide the key-value pair as sampleapp=jpetstore
  2. When you have contexts like /api/1, /api/2 and you want to monitor them as a single application, they can be grouped as /api/\d+=/api

Keep in mind:

  • Background transactions are not shown for individual contexts. Since it is not possible to identify which context triggered a background transaction, background transactions are captured at the JVM level, and the data is shown at the application level.
  • Thread profiling is completed for the entire JVM and is not specific to context. Irrespective of which context the profiling is initiated from, it's performed on whole JVM and pushed to the main APM application (the one with name provided in the configuration file).

Note: This feature is available only from APM Insight Java agent version 4.4 

Disabling context-based monitoring

To disable context based monitoring:

  1. Add the following parameter in your apminsight.conf file:
    • "context.monitoring.enabled=false"
  2. In your agent directory, check for the directory "apminsight_monitors," and delete it, if it exists.
  3. Restart your app server.

Was this document helpful?

Would you like to help us improve our documents? Tell us what you think we could do better.


We're sorry to hear that you're not satisfied with the document. We'd love to learn what we could do to improve the experience.


Thanks for taking the time to share your feedback. We'll use your feedback to improve our online help resources.

Shortlink has been copied!