Introduction
In previous tutorials, you learnt different Siddhi concepts and created many Siddhi applications to try them out. However, those Siddhi applications were created in the Stream Processor Studio and they were not deployed in a production environment.
In this tutorial, let's consider a scenario where your Siddhi applications are deployed in a production environment, and in a worker profile. The node is configured to execute Siddhi applications, and it does not have a UI (User Interface).
The staff at the Sweet Factory need to check whether the SP nodes in which their Siddhi applications are deployed are working as expected, or whether any Siddhi application requires performance improvements. They need a user-friendly UI in order to monitor this. For this purpose, you can use the Monitoring Dashboard of WSO2 SP.
This tutorial covers how to use the Monitoring Dashboard.
Tutorial steps
Let's get started!
- Let's start the dashboard profile of WSO2 Stream Processor by issuing one of the following commands from the
<SP_HOME>/bin
directory.For Windows:
dashboard.bat
For Linux:
sh dashboard.sh
To access the Monitoring Dashboard, you can use the following URL.
https://localhost:9643/monitoring
You can login to the dashboard by specifyingadmin
as both the username and the password.Here, we are using the credentials available by default to access the dashboard. If you are using a different user, make sure that it is granted the relevant permissions to add/delete workers from the dashboard. For more details, see User Management via the IdP Client Interface.
The following is displayed once you login.
- Let's add a worker to view statistics for it. To do this, follow the substeps below.
- Click Add New. This opens the following page.
Let's add
localhost
as the host and9443
as the HTTPS port.These are the default host and port of a single node. If the worker node is not run in the same computer as the dashboard node or if it is run on a different port, change these values accordingly.
Click Add Node to proceed. As a result, the following is displayed.
To monitor a worker node (which we will run later onlocalhost:9443
), click Worker.
The dashboard indicates that there is no worker running at the host and port you specified because you have not started a worker node yet.
- Click Add New. This opens the following page.
To view an active worker, let's start a worker node by issuing one of the following commands from the
<SP_HOME>/bin
directory.In this tutorial, you can run the worker and the dashboard in the same computer for simplicity.
For Windows:
worker.bat
For Linux:
sh worker.sh
To view more information about the worker node, let's click on it. This opens a page named localhost:9443, displaying information specific to the worker node you started as shown below.
Ths information is displayed in this page after a time period of about 30 seconds after opening it.
Note that no information is currently displayed under Overall Throughput (events/second) and Siddhi Applications. This is because no Siddhi applications are deployed in this worker.- Let's deploy and run a Siddhi application in the worker. For this purpose, you can use the
SweetTotalApp
that you created in Tutorial 1 and updated in Tutorial 2.
You can deploy the Siddhi application by copying theSweetTotalApp.siddhi
file from the<SP_HOME>/wso2/editor/deployment/workspace
directory and pasting it in the<SP_HOME>/wso2/worker/deployment/siddhi-files
directory. - To view the Siddhi application you deployed, let's refresh the localhost:9443 page. The
SweetTotalsApp
Siddhi application is displayed in the Siddhi Applications section as follows. - To view information specific to the Siddhi application, click on it. This opens a page named localhost:9443 > SweetTotalApp as shown below.
- Metrics are not enabled for Siddhi applications by default. Let's enable metrics for the
SweetTotalApp
Siddhi application by clicking the Metrics switch. This displays available information relating to the latency, overall throughput and memory used, as well as available statistics for the Siddhi application as shown below.