Setting up Dashboards to Display WSO2 SI Statistics¶
This section explains how WSO2 Streaming Integrator servers can be configured to publish data to Prometheus and display statistics in Grafana dashboards.
Before you begin:
- Download and install Prometheus. For instructions, see the Prometheus Getting Started Guide.
- Download Grafana from Grafana Labs - Download Grafana.
Configuring Servers¶
In order to configure a Grafana dashboard, follow the steps below:
-
Configure Prometheus reporter in Streaming Integrator
Enable statistics for the Prometheus reporter as follows.
- To enable statistics for the Prometheus reporter, open the
<SI_HOME>/conf/server/deployment.yaml
file and set theenabled
parameter in thewso2.metrics
section totrue
, and update the other parameters in the section as shown below. You also need to add themetrics.prometheus:
as shown.
- To enable statistics for the Prometheus reporter at Siddhi application level, use thewso2.metrics: # Enable Metrics enabled: true reporting: console: - # The name for the Console Reporter name: Console # Enable Console Reporter enabled: false # Polling Period in seconds. # This is the period for polling metrics from the metric registry and printing in the console pollingPeriod: 2 metrics.prometheus: reporting: prometheus: - name: prometheus enabled: true serverURL: "http://localhost:9005"
@App:statistics
annotation in the required Siddhi applications to set thereporter
parameter as shown in the example below.@App:name('TestMetrics') @App:statistics(reporter = 'prometheus') define stream TestStream (message string);
- To enable statistics for the Prometheus reporter, open the
-
Start Streaming Integrator server
To start the Streaming runtime, navigate to the
<SI_HOME>/bin
directory and issue the appropriate command based on your operating system.- For Windows:
server.bat --run
- For Linux/MacOS:
./server.sh
- For Windows:
-
Start the Prometheus server
Start and run the Prometheus server by following the procedure below.
-
Open the
<PROMETHEUS_HOME>/prometheus.yml
file and add the following configuration in thescrape_configs:
section.
2. Start the Prometheus server by issuing the following command in the terminal.scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['localhost:9005']
./prometheus
-
-
Start and configure the Grafana server
To start and configure the Grafana server, follow the procedure below:
-
Start Grafana
Info
The procedure to start Grafana depends on your operating system and the installation process. e.g., If your operating system is Mac OS and you have installed Grafana via Homebrew, you start Grafana by issuing the
brew services start grafana
command. -
Access Grafana via
http://localhost:3000/
. -
In the Data Sources section, click Add your first data source. In the Add data source page that appears, click Select for Prometheus.
-
In the Add data source page -> Settings tab, update the configurations for Prometheus as follows.
1. Click **Default** to make Prometheus the default data source. 2. Under **HTTP**, enter `http://localhost:9090` as the URL. 3. Click **Save & Test**. If the data source is successfully configured, it is indicated via a message. ![Save and Test](../images/cdc-monitoring/save-and-test.png)
-
-
Load dashboards into Grafana
WSO2 Streaming Integrator offers pre-built dashboards for monitoring streaming data flows and server statistics. To load them, follow the procedure below:
-
Download the required JSON file (i.e., based on the statistics you need to view) from here.
-
Start Grafana and access it via
http://localhost:3000/
. -
To load a new dashboard, click the plus icon (+) in the side panel. Then click Import.
-
In the Import page, click Upload .json file. Then browse and select the .json file of the preconfigured dashboard that you downloaded (i.e., in step 5, substep 1).
-
If required, change the unique identifier displayed in the Unique Identifier (uid).
-
Click Import.
-