Java APM

Get AI insights and automated debugging experience for your Java applications by using the Middleware Java Agent (version '1.7.0' or higher).

🚀 Key Features

  • Capture exception and error details automatically
  • Framework agnostic
  • Exception method recording for all files
  • Library file detection for more focussed error tracking

🛠️ APM Setup

  1. Download the Middleware Java Agent To download Middleware Java Agent with OpsAI support download it from our Github Release Page (version '1.7.0' or higher)

  2. Run your java project with the Agent Add the -javaagent flag before the -jar parameter when running your Java application, specifying the full path to the Middleware agent JAR file.

Eg:

⚡ Exception Code Capturing

The SDK automatically captures:

  • Exception types and messages
  • Stack traces with line numbers
  • Function names and bodies
  • File paths and line ranges
  • Library file detection (for files in ~/.m2/repository/, ~/.gradle/caches/, lib/, libs/, JAR files in classpath, and External JARs, Maven/Gradle dependencies )

Automatic Detection

The SDK will automatically detect:

  • Git commit SHA
  • Repository URL from your project's .git directory. No additional configuration is needed if your project is a git repository.

Manual Configuration

If you need to override the automatic detection or if your project is not a git repository, you can set these environment variables:

This lets Middleware know exactly which version of your code is running, so it can suggest the right fix and even create a solution PR for you.

Turning Off OpsAI:

The OpsAI support for Java APM is enabled by default. To opt out you can set the environment variable MW_OPSAI_SUPPORT=false

Eg.

📚 Resources