This documentation is for WSO2 Enterprise Integrator version 6.5.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


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

  • Go to the management console of the ESB profile: https://localhost:9443/carbon
  • 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 HealthcareAPI listed as follows:
    Enable statistics for the REST API
  • 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.
    Enable statistics for the endpoint artifacts

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.

    Code Block
    "name": "John Doe",
    "dob": "1940-03-19",
    "ssn": "234-23-525",
    "address": "California",
    "phone": "8770586755",
    "email": "",
    "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.

    Code Block
    "doctorName":"thomas collins",
    "patient":"John Doe",
  3. Now, shut down the MSF4J server (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:

    1. Open a terminal and navigate to the <EI_HOME>/wso2/analytics/bin directory.

    2. Start the runtime by executing the message broker startup script as shown below

      Localtab Group
      titleOn MacOS/Linux/CentOS
      Code Block
      titleOn Windows
      Code Block
  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. 


    Note: Users should include certificates with SAN fields, otherwise an SSLHandshakeException will occur when they try to open the Analytics dashboard.

  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.
    1. 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
    2. 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
    3. 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
    4. 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
    5. 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.

    1. ChannelingFeeEP
    2. SettlePaymentEP
    3. 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