Enhancing WSO2 Product Observability: Integrating Azure Application Insights for Open Tracing Monitoring 🚀
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:
- Create an application in the Azure portal
- 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.
3️⃣ Provide Application Details
- Enter a name for your Application Insights instance.
- Click Review + Create to finalize the setup.
- Once the application is created, navigate to the Application Overview dashboard and copy the Connection String.
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.
This will populate the most recent events in 30 30-minute timeframe as below.
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.
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.
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