Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✅ |
Prerequisites
1
Infra Agent
Infrastructure Agent (Infra Agent). To install the Infra Agent, see our Installation Guide.
2
Java Version
Java version 8
or above. Check your Java version with the following command:Shell
Install
Step 1: Download JAR File
Download the latest Middleware instrumentation JAR file from the Github Release Page.Step 2: Container Variables
Applications running in a container require an additional environment variable. If your application is not running in a container, move to Step 3.Docker
Add the following environment variable to your application:Shell
The
DOCKER_BRIDGE_GATEWAY_ADDRESS
is the IP address of the gateway between the Docker host and bridge network. This is 172.17.0.1
by default.
Learn more about Docker bridge networking here Kubernetes
Run the following command to find themw-service
in Kubernetes:
Kubernetes
Run the following command to find themw-service
in Kubernetes:
Shell
Shell
Step 3: Capture Application Data
Traces
Distributed tracing will be automatically enabled upon completing Step 4: Run Application.Metrics
Metrics collection will be automatically enabled upon completing Step 4: Run Application.Application & Custom Logs
Application Logs will be automatically enabled upon completing Step 4: Run Application. To add custom logs, add this dependency in thepom.xml
file:
Java
Shell
Java
Java
Profiling
Application Profiling is automatically enabled upon completing Step 4: Run Application.Stack Traces
Use the Logger.recordError(e) method to record a stack trace when an error occurs. See an example of this method below.Java
Step 4: Run Application
Run your application with the command given below.Java
Continuous Profiling
Continuous profiling captures real-time performance insights from your application to enable rapid identification of resource allocation, bottlenecks, and more. Navigate to the Continuous Profiling section to learn more about using Continuous Profiling with the Java APM. Need assistance or want to learn more about Middleware? Contact us at support[at]middleware.io.