The Analytics profile of WSO2 Enterprise Integrator (WSO2 EI) allows you to publish the message mediation related statistics in WSO2 EI and to analyze them using the Analytics Dashboard. Once the data from the mediation artifacts are published to the Analytics profile, the dashboard will provide an overview of the mediation artifacts as well as separate statistics on each of the artifacts.
Before you begin,
- Download the product installer from here, and run the installer.
Let's call the installation location of your product the
Note that if you used the product installer to install your product, the
<EI_HOME>is located in a place specific to your OS as shown below:
OS Home directory Mac OS
- Download the MSF4J service from here and copy the JAR file to the
<EI_HOME>/wso2/msf4j/deployment/microservicesfolder. The back-end service is now deployed in the MSF4J profile of WSO2 EI.
Select and download the relevant EI tooling ZIP file based on your operating system from here and then extract the ZIP file.
The path to this folder will be referred to as
<EI_TOOLING>throughout this tutorial.
Open the EI Tooling environment and click File -> Import. Then, select Existing WSO2 Projects into workspace under the WSO2 category, click Next and upload the extracted pre-packaged C-App project. This C-App contains the configurations of the service chaining tutorial. On the Servers tab, right-click the WSO2 EI server, select Add and Remove and choose SampleServicesCompositeApplication, and click Finish.
- If you are running on Windows, download the
snappy-java_22.214.171.124.jarfrom here and copy the JAR file to
When you are in a production environment, be sure to configure data purging for your analytics server before using analytics. Otherwise, too much data will get accumulated in the analytics server over time and cause performance issues.
Let's get started!
Setting up Analytics
Set the following properties in the
<EI-HOME>/conf/synapse.properties file to
true so that the ESB profile can publish mediation statistics:
Starting the servers
Let's start the Analytics, ESB, and MSF4J profiles as follows:
Be sure to start the Analytics profile first and then start the ESB profile.
Start the Analytics profile:
- Start the ESB runtime from within Tooling. For instructions, see Starting the Integrator runtime and deploying the artifacts.
Start the back-end service (which is an MSF4J service):
Enabling statistics and tracing for the artifacts
Follow the steps below to enable statistics and tracing for the REST API:
- Go to the management console of the ESB profile:
- On the Main tab of the management console, go to Manage -> Service Bus and click APIs.
The Deployed APIs screen appears, and you will see the
HealthcareAPIlisted as follows:
- To enable the collection of mediation statistics for the REST API, click Enable Statistics.
To enable mediation tracing for the REST API, click Enable Tracing.
Note that it is not recommended to enable tracing in production environments as it generates a large number of events that reduces the performance of the analytics profile. Therefore, tracing should only be enabled in development environments.
Follow the steps below to enable statistics for the endpoints:
- On the Main tab of the management console, go to Manage -> Service Bus, and click Endpoints.
The Manage Endpoints screen appears, and you will see several endpoints listed.
- To enable the collection of mediation statistics for the endpoints, click Enable Statistics for each endpoint.
Sending a message
Now that you have the artifacts deployed and configured for statistics monitoring, send a request to the ESB profile.
Create a JSON file called
request.jsonwith the following request payload.
- Open a command line terminal and execute the following command from the location where you save the request.json file:
curl -v -X POST --data @request.json http://localhost:8280/healthcare/categories/surgery/reserve --header "Content-Type:application/json"
If the message mediation is successful, you will see the following response:
Analyze the mediation statistics
Now, let's analyze the statistics generated from the message mediation:
- In a new browser window or tab, open
https://localhost:9444/carbon/and log into the Analytics management console using
adminfor both the username and password.
- On the Main tab, click Analytics Dashboard and log in using
adminfor both the username and password. You will then see the following:
Click View to open the EI-Analytics Dashboard. The OVERVIEW page is displayed by default.
To view statistics for the REST API, click API on the left navigator and search for
For more information on analyzing statistics displayed on this page, see Analyzing Statistics for REST APIs.
- To view statistics for an endpoint, click ENDPOINT on the left navigator and search for the required endpoint. You can view statistics for the following endpoints on this page:
You have now explored how to use EI-Analytics dashboard.