Enhancing WSO2 Product Observability: Integrating Azure Application Insights for Open Tracing Monitoring 🚀

Sumudu Sahan Weerasuriya
4 min readFeb 3, 2025

--

Hello Geeks! 😊😊😊

Today, I’ll walk you through the process of configuring Azure Application Insights with WSO2 products (API Manager, Micro Integrator, Enterprise Integrator, etc.) for basic monitoring purposes. 🤓🤓🤓

Currently, almost all WSO2 products support OpenTracing observability solutions. However, Azure Application Insights is not officially supported yet. This means you may face some challenges while setting up the OpenTracing solution with Azure Application Insights.

But don’t worry! You can still achieve this by following two key steps:

  1. Create an application in the Azure portal
  2. Configure the Application Insights Java agent at the product level

Let’s dive in quickly like a BOSS! 😎😎😎

Step 1: Creating an Application in Azure Portal

For this example, I will take the WSO2 API Manager 4.0.0 product. But you can configure any WSO2 product with Azure Application Insights by following this solution.

1️⃣ Download the Azure Application Insights Agent JAR file

  • Get the agent JAR file from Microsoft’s official repository [1].

2️⃣ Access the Azure Portal

  • Go to the Microsoft Azure portal [2].
  • Search for Application Insights in the marketplace.
  • Click on Create to set up a new Azure Application Insights instance.
Create an application- Azure Application Insights

3️⃣ Provide Application Details

  • Enter a name for your Application Insights instance.
Application Name — Azure Application Insights
  • Click Review + Create to finalize the setup.
  • Once the application is created, navigate to the Application Overview dashboard and copy the Connection String.
Application Overview — Azure Application Insights

Step 2: Configuring the Application Insights Agent in WSO2

1️⃣ Create the applicationinsights.json File

Inside a new file named applicationinsights.json, add the following content:

{
"connectionString": "CONNECTION_STRING_GOES_HERE"
}

Replace CONNECTION_STRING_GOES_HERE with the actual connection string you copied earlier.

📌 Save this file in the same directory where the Application Insights Agent JAR file is located.

2️⃣ Modify the WSO2 Startup Script

  • Navigate to the startup script of the WSO2 product:
cd <PRODUCT_HOME>/bin

Example: api-manager.sh for WSO2 API Manager.

  • Find the JVM runtime flag section and add the following line:
-javaagent:"/PATH/TO/AGENT/applicationinsights-agent-3.7.0.jar" \

Replace PATH/TO/AGENT with the actual file path of the downloaded JAR file.

3️⃣ Start the WSO2 Product

  • Run the startup script to launch the WSO2 product.
sh api-manager.sh

Step 3: Viewing Traces and Performance in Azure Application Insights

Once the WSO2 product starts, you can monitor the observability data in Azure Application Insights.

1️⃣ Access Transaction Logs

  • Go to the Azure portal and select the Application Insights instance you created.
  • Click on Search.
  • Under Transaction Search, select Last 30 minutes in the Time Range section.
Time range — Azure Application Insights

This will populate the most recent events in 30 30-minute timeframe as below.

Filtered events — Azure Application Insights

2️⃣ Monitor Performance Metrics

Since WSO2 products are now publishing events to Azure Application Insights, you can track performance using built-in monitoring tools.

📊 Performance graphs and logs will help you analyze request traces, dependencies, and latency.

Performance — Azure Application Insights

3️⃣ Monitor Live Metrics

With Live Metrics, you can track real-time data, helping you assess the overall health of the system, analyze incoming and outgoing request traffic, and detect potential performance bottlenecks. This feature provides low-latency monitoring and enables you to visualize key metrics such as request rates, failure rates, and response times as they happen.

Key benefits of Live Metrics:

  • Real-time visibility: Instantly see how your WSO2 product is performing without waiting for log analysis.
  • Proactive issue detection: Identify slow transactions and potential failures before they impact users.
  • Performance optimization: Fine-tune your system by analyzing traffic patterns and resource utilization.

You can access Live Metrics by navigating to the Live Metrics Stream section in your Azure Application Insights dashboard. Here, you’ll be able to view system performance and request telemetry in real-time.

Live metrics — Azure Application Insights

Congratulations! 🎉

You have successfully integrated Azure Application Insights with WSO2 products using the OpenTracing approach! 🤠🤠🤠

For more details, refer to the official documentation [1].

Happy Monitoring! 🚀😎😎😎

[1] https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable?tabs=java

[2] https://portal.azure.com/#home

--

--

Sumudu Sahan Weerasuriya
Sumudu Sahan Weerasuriya

Written by Sumudu Sahan Weerasuriya

Associate Technical Lead @ WSO2 | 2nd Runner-Up of WSO2 Certified Employee of the Year — 2021 | 10X WSO2 Certified | BIT(UCSC) | DiHN | OCPJP

No responses yet