Modern enterprises need deep observability into their integration flows to ensure reliability, performance, and rapid troubleshooting. Application Performance Monitoring (APM) addresses this by providing distributed tracing, real-time analytics, and actionable insights. WSO2 Micro Integrator (MI), starting from version 4.2, offers robust native integration with industry-leading APM platforms—including Elastic APM—through the OpenTelemetry Protocol (OTLP).
This guide provides a comprehensive, step-by-step approach to integrating Elastic APM with WSO2 Micro Integrator using OpenTelemetry, unlocking full application and transaction tracing across your microservices and integration components.
Why Integrate APM with WSO2 Micro Integrator?
- End-to-end transaction visibility: Trace messages and API calls as they traverse your integration flows.
- Performance bottleneck identification: Pinpoint slow mediators, connectors, or endpoints.
- Faster root cause analysis: Quickly diagnose and resolve errors or latency issues.
- Unified observability: Correlate data from MI with your broader application ecosystem in Elastic.
Approach: OpenTelemetry-Based Distributed Tracing
(Best Practice for Elastic APM)
How It Works
- WSO2 MI emits trace data (spans) for each integration invocation.
- Trace data is sent via the OpenTelemetry Protocol (OTLP) directly to an Elastic APM server.
- Elastic APM collects, visualizes, and analyzes traces to provide insight into integration behavior and performance.
Step-by-Step Integration
1. Prerequisites
- WSO2 Micro Integrator 4.2+ installed.
- Elastic APM Server (v7.16 or newer recommended).
- Network connectivity between MI and the Elastic APM server.
2. Enable and Configure OpenTelemetry Tracing in MI
Edit the deployment.toml
file (usually located at MI_HOME/repository/conf/deployment.toml
):
[tracing]
enabled = true
tracer_type = "otlp"
exporter.reporter = "otlp"
exporter.endpoint = "http://:8200"
- Replace
with the hostname or IP address of your Elastic APM server. - The default Elastic APM OTLP endpoint is port 8200.
Optional: Configure Service Name and Attributes
You can specify a custom service name for easier identification in Elastic:
[tracing]
enabled = true
tracer_type = "otlp"
exporter.reporter = "otlp"
exporter.endpoint = "http://:8200"
service_name = "wso2-mi-prod"
3. Configure Elastic APM Server for OTLP
- Out of the box, Elastic APM Server (v7.16+) supports OTLP ingest without extra configuration.
- Ensure that network firewalls allow inbound OTLP traffic on port 8200.
4. Restart WSO2 Micro Integrator
For changes to take effect, restart the MI server:
./micro-integrator.sh stop
./micro-integrator.sh start
(Or use relevant commands for your deployment environment.)
5. Verify Trace Data in Elastic APM
- Invoke APIs or proxy services deployed on MI.
- Open the Elastic APM UI (usually via Kibana).
- Navigate to the Services section—your MI traces (with the configured service name) should appear.
- Drill down into traces to view spans, timings, errors, and end-to-end integration flows.
Troubleshooting Tips
-
No traces in APM UI?
- Double-check the
deployment.toml
values and ensure the MI server can reach the Elastic APM endpoint. - Inspect MI logs for errors related to tracing or network connectivity.
- Double-check the
-
Missing spans or incomplete traces?
- Ensure your integration flows are not filtering out tracing headers or context.
- Confirm Elastic APM server health and log files for ingest errors.
Benefits of This Approach
- Native, standards-based integration—no third-party agents required.
-
Minimal configuration—just a few lines in
deployment.toml
. - Seamless Elastic APM visualization—all MI transaction data is accessible and searchable.
- Scalable and future-proof—leverages the OpenTelemetry standard adopted widely across the industry.