com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Using the Analytics Dashboard

The Analytics profile of WSO2 Enterprise Integrator (WSO2 EI) allows you to analyze the statistics related to the message mediation that is carried out in the ESB profile of WSO2 EI. Once the data from the mediation artifacts in the ESB profile are published to the Analytics profile, the dashboard will display the statistics.

In this tutorial, you will use the Analytics dashboard to view and analyze the statistics that are carried out in the tutorial on Exposing Several Services as a Single Service.

Before you begin,

  • Download the product installer from here, and run the installer.
    Let's call the installation location of your product the <EI_HOME> directory. This is located in a place specific to your OS as shown below:
    OSHome directory
    Mac OS/Library/WSO2/EnterpriseIntegrator/6.6.0
    WindowsC:\Program Files\WSO2\EnterpriseIntegrator\6.6.0\
    Ubuntu/usr/lib/wso2/EnterpriseIntegrator/6.6.0
    CentOS/usr/lib64/EnterpriseIntegrator/6.6.0
  • Select the relevant WSO2 Integration Studio based on your operating system and download it from here.
    The path to this folder is referred to as <EI_TOOLING> throughout this tutorial.

    Getting an error message? See the troubleshooting tips given under Installing WSO2 Integration Studio.

  • If you did not try the Exposing Several Services as a Single Service tutorial yet,
    1. Download the pre-packaged project that contains the configurations of the Exposing Several Services as a Single Service tutorial.
    2. Open WSO2 Integration Studio, click File, and click Import.
    3. Next, expand the WSO2 category and select Existing WSO2 Projects into workspace, click Next, and upload the project file.
  • If you are running on Windows, download the snappy-java_1.1.1.7.jar from here and copy the JAR file to <EI_HOME>\lib directory.

Let's get started!

Starting the Analytics worker

Follow the steps relevant to your OS to start the Analytics worker:

Be sure to start the Analytics profile before starting the ESB profile.

Enabling statistics and tracing for the artifacts

Follow the steps below to enable statistics and tracing for the REST API:

  1. Open WSO2 Integration Studio and open the REST API artifact.
  2. Click the REST API icon (in the design view) to open the Properties tab for the REST API. 
  3. To enable the collection of mediation statistics for the REST API, select Enable Statistics (shown above).
  4. To enable mediation tracing for the REST API, select Enable Tracing (shown above).

    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.

  5. To enable statistics and tracing for the endpoint artifacts, open the Form view of the endpoint artifact and set the Trace Enabled and Statistics Enabled values to 'True'. For example, see the QueryDoctorEP endpoint:
  6. Similarly, you can enable tracing and statistics for all the required endpoint artifacts.
  7. Ensure that all the artifacts are packaged in the composite application: 
    1. Open the pom.xml file of the SampleServicesCompositeApplication project, which is already included in the project explorer.
    2. Select the artifacts that need to be included into the CAR file.

Configuring the ESB server for analytics

Before starting the ESB profile, you need to configure the ESB to profile to publish mediation statistics to the Analytics worker. Open the  <EI-HOME>/conf/synapse.properties file and set the following properties to true as shown below.

...
mediation.flow.statistics.enable=true
mediation.flow.statistics.tracer.collect.payloads=true
mediation.flow.statistics.tracer.collect.properties=true
...

Starting the ESB profile and deploying the artifacts

Be sure to start the Analytics profile before starting the ESB profile.

If you do not already have an ESB server added to WSO2 Integration Studio, follow the instructions in a previous tutorial.

If you have already added the ESB profile server and deployed SampleServicesCompositeApplication (in a previous tutorial):

  1. Go to the Servers tab and click  to start the server. 
  2. Right-click SampleServicesCompositeApplication and click Redeploy as shown below.

The server Console will indicate that the CApp has been redeployed successfully.

Starting the back-end service

Download and start the back-end service that will process appointment requests:

  1. Download the JAR file of the back-end service.
  2. Open a terminal and navigate to the location where your saved the back-end service.

  3. Execute the following command to start the service:

    java -jar Hospital-Service-JDK11-2.0.0.jar

The Healthcare service is now active and you can start sending requests to the service.


Sending a message

Now that you have the artifacts deployed and configured for statistics monitoring, let's send 8 requests to the ESB profile as explained below.

For the purpose of demonstrating how successful messages and message failures are illustrated in the dashboard, let's send 2 of the requests while the back-end service is not running. This should generate a success rate of 75%.

  1. Create a JSON file called request.json with the following request payload.

    {
    "name": "John Doe",
    "dob": "1940-03-19",
    "ssn": "234-23-525",
    "address": "California",
    "phone": "8770586755",
    "email": "johndoe@gmail.com",
    "doctor": "thomas collins",
    "hospital": "grand oak community hospital",
    "cardNo": "7844481124110331",
    "appointment_date": "2025-04-02"
    }
  2. Open a command line terminal and execute the following command (six times) 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 messages are sent successfully, you will receive the following response for each request.

    {"appointmentNo":1,
    "doctorName":"thomas collins",
    "patient":"John Doe",
    "actualFee":7000.0,
    "discount":20,
    "discounted":5600.0,
    "paymentID":"e1a72a33-31f2-46dc-ae7d-a14a486efc00",
    "status":"Settled"}
  3. Now, shut down the back-end service (to ensure that the back-end service is inactive) and send two more requests.

Analyze the mediation statistics

Now, let's analyze the statistics generated from the message mediation:

  1. Start the Analytics dashboard:

  2. In a new browser window or tab, open the Analytics dashboard using the following URL: https://localhost:9643/portal. Use admin for both the username and password. 

  3. Click the Enterprise Integrator Analytics icon shown below to open the dashboard.
    Opening the Analytics dashboard for WSO2 EI

  4. View the statistics overview for all the ESB artifacts that have published statistics:
    ESB total request count

  5. The number of transactions handled by the ESB per second is mapped on a graph as follows.

    ESB overall TPS

  6. The success rate and the failure rate of the messages received by the ESB profile during the last hour are mapped in a graph as follows.
    ESB overall message count

  7. The HealthcareAPI REST API is displayed under TOP APIS BY REQUEST COUNT as follows.
    Top APIs by request count

  8. The three endpoints used for the message mediation are displayed under Top Endpoints by Request Count as shown below. 
    Top endpoints by request count
  9. In the Top APIS BY Request COUNT gadget, click  HealthcareAPI to open the OVERVIEW/API/HealthcareAPI page. The following is displayed.
    • The API Request Count gadget shows the total number of requests handled by the StockQuoteAPI REST API during the last hour:
      Total request per API
    • The API Message Count gadget maps the number of successful messages as well as failed messages at different times within the last hour in a graph as shown below.
      API message count
    • The API Message Latency gadget shows the speed with which the messages are processed by mapping the amount of time taken per message at different times within the last hour as shown below.
      API message latency
    • The Messages gadget lists all the the messages handled by the StockQuoteAPI REST API during the last hour with the following property details as follows.
      Message per API
    • The Message Flow gadget illustrates the order in which the messages handled by the StockQuoteAPI REST API within the last hour passed through all the mediation sequences, mediators and endpoints that were included in the message flow as shown below.
      Message flow per API
  10. In the Top Endpoints by Request Count gadget, click one of the endpoints to view simillar statistics per endpoint.

    • ChannelingFeeEP
    • SettlePaymentEP
    • GrandOaksEP
  11. You can also navigate to any of the artifacts by using the top-left menu as shown below. For example, to view the statistics of a specific endpoint, click Endpoint and search for the required endpoint. 
    Dashboard navigation menu 
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.