Versions Compared

Key

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

This section covers how The Status Dashboard of WSO2 SP allows you to monitor the metrics of a stand-alone WSO2 SP instance or a WSO2 SP cluster. This involves monitoring whether all processes of the WSO2 SP setup are working in a healthy manner,monitoring the current status of a SP node, and viewing metrics relating to the history of a node or the cluster.  Both JVM level metrics or Siddhi application level metrics can be viewed from the monitoring dashboard.

Table of ContentsmaxLevel2minLevel2The following sections cover how to configure the Status Dashboard and analyze statistics relating to your WSO2 SP deployment in it.

Child pages (Children Display)

Excerpt
hiddentrue


Anchor
Configure
Configure
Prerequisites

In order to configure the Status Dashboard all worker node should have unique carbon ID. Other than that the following prerequisites must be completed.

Table of Contents
maxLevel3
minLevel3

Setting up the database

To work monitoring dashboard you need to have shared metrics

...

database for all your nodes for store metrics of the nodes and carbon metrics use carbon ID as source ID for all yor worker need to have unique carbon ID under the  <SP_HOME>/conf/worker/deployment.yml

      wso2.carbon:
# value to uniquely identify a server
id: wso2-sp
# server name
name: WSO2 Stream Processor
# ports used by this server

Monitoring

...

dashboard is supported only H2, MySQL, MSSQL and Oracle databases

...

. If you wish to continue H2 database you can ignore this step.

...

  

Set up a  database by following the

...

substeps below.

  1. Download

...

  1. the particular

...

  1. database driver.
  2. Unzip the downloaded driver zipped archive, and copy the database driver JAR (xxx.jar) into the <SP_HOME>/lib directory of all the nodes in the cluster.
  3. Create 2

...

  1. databases for storing metrics details (Ex. wso2_metrics)  and dashboard details(Ex. monitoring).
  2. Populate the metrics tables using the corresponding script which

...

  1. matches to your database type which is in the <SP_HOME>/wso2/dashboard/dbscripts.
  2. Edit carbon datasorce configuration in both <SP_HOME>/conf/worker/deployment.yml and <SP_HOME>/conf/dashboard/deployment.yml  based on your database types. 

    Database TypeMetrics

...

  1. DatasourceDashboard Datasource
    MySQL
    - name: WSO2_METRICS_DB
    description: The datasource used for dashboard feature
    jndiConfig:
    name: jdbc/WSO2MetricsDB
     

...

  1.   

...

  1.  

...

  1.     

...

  1.   

...

  1.  

...

  1.  

...

  1.  

...

  1.       

...

  1. definition:

...

  1. 
         

...

  1.  

...

  1.       

...

  1.  

...

  1.       

...

  1. type: 

...

  1. RDBMS
    configuration:

...

  1.   

...

  1.  

...

  1.       

...

  1.  

...

  1.       

...

  1.  

...

  1.  

...

  1. jdbcUrl: 

...

  1. 
     

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.   

...

  1.  

...

  1.  

...

  1.        'jdbc:mysql://localhost/wso2_metrics?useSSL=false'
    username: root
    password: root
    driverClassName: com.mysql.jdbc.Driver
    maxPoolSize: 50
    idleTimeout: 60000
    connectionTestQuery: SELECT 1
    validationTimeout: 30000
    isAutoCommit: false
    - name: WSO2_STATUS_DASHBOARD_DB
    description: The datasource used for dashboard feature
    jndiConfig:
    name: jdbc/wso2_status_dashboard
    useJndiReference: true
    definition:
    type: RDBMS
    configuration:
    jdbcUrl: 'jdbc:mysql://localhost/monitorng?useSSL=false'
    username: root
    password: root
    driverClassName: com.mysql.jdbc.Driver
    maxPoolSize: 50
    idleTimeout: 60000
    connectionTestQuery: SELECT 1
    validationTimeout: 30000
    isAutoCommit: false
    MSSQL
    - name: WSO2_METRICS_DB
    description: The datasource used for dashboard feature
    jndiConfig:
    name: jdbc/WSO2MetricsDB
    definition:
    type: RDBMS
    configuration:
    jdbcUrl: 'jdbc:sqlserver://localhost;databaseName=wso2_metrics'
    username: root
    password: root
    driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
    maxPoolSize: 50
    idleTimeout: 60000
    connectionTestQuery: SELECT 1
    validationTimeout: 30000
    isAutoCommit: false
    - name: WSO2_STATUS_DASHBOARD_DB
    description: The datasource used for dashboard feature
    jndiConfig:
    name: jdbc/wso2_status_dashboard
    useJndiReference: true
    definition:
    type: RDBMS
    configuration:
    jdbcUrl: 'jdbc:

...

  1. sqlserver://localhost

...

  1. ;databaseName=monitoring'
    username: root
    password: root
    driverClassName: com.microsoft.

...

  1. sqlserver.jdbc.

...

  1. SQLServerDriver
    maxPoolSize: 50
    idleTimeout: 60000
    connectionTestQuery: SELECT 1
    validationTimeout: 30000
    isAutoCommit: false

...

  1. Oracle
    - name: WSO2_METRICS_DB
    description: The datasource used for dashboard feature
    jndiConfig:
    name: jdbc/WSO2MetricsDB
    definition:
    type: RDBMS
    configuration

...

  1. :

...


...

  1. 
    

...

  1.       

...

  1.  

...

  1.       

...

  1.  

...

  1.      

...

  1. jdbcUrl: 
       

...

  1.  

...

  1.       

...

  1.  

...

  1.  

...

  1.       

...

  1. 'jdbc:oracle:thin:@localhost:1521/xe'

...

  1.  

...

  1.  

...

  1.  

...

  1.   

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  
    

...

  1.  

...

  1.  

...

  1.     

...

  1.  

...

  1.   

...

  1.  

...

  1.  

...

  1.     

...

  1.  

...

  1.  

...

  1.  username: root
    password: root
    driverClassName:

...

  1. oracle.

...

  1. jdbc.

...

  1. driver.

...

  1. OracleDriver
    maxPoolSize: 50
    idleTimeout: 60000
    connectionTestQuery: SELECT 1
    validationTimeout: 30000
    isAutoCommit: false

...

  1. - name: WSO2_STATUS_

...

  1. DASHBOARD_DB
    description: The datasource used for dashboard feature
    jndiConfig:
    name: jdbc/

...

  1. wso2_status_dashboard
    useJndiReference: true
    definition:
    type: RDBMS
    configuration:

...

  1. 
    

...

  1.  

...

  1.  

...

  1.       

...

  1.  

...

  1.       

...

  1.  

...

  1.    

...

  1. jdbcUrl: 
       

...

  1.  

...

  1.       

...

  1.  

...

  1.  

...

  1.       

...

  1. 'jdbc:oracle:thin:@localhost:1521/xe'

...

  1.  

...

  1.  

...

  1.  

...

  1.   

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  

...

  1.  
    

...

  1.  

...

  1.  

...

  1.     

...

  1.  

...

  1.   

...

  1.  

...

  1.  

...

  1.     

...

  1.  

...

  1.  

...

  1.  username: root
    password: root
    driverClassName: oracle.jdbc.driver.OracleDriver
    maxPoolSize: 50
    idleTimeout: 60000
    connectionTestQuery: SELECT 1
    validationTimeout: 30000
    isAutoCommit: false

    Please refere for more details https://github.com/wso2/carbon-datasources/

  2. If you are changing name of datasorces which is default names WSO2_STATUS_DASHBOARD_DB and WSO2_METRICS_DB then you have to map them in the deployment.yml under wso2.status.dashboard namespace which is in the <SP_HOME>/conf/dashboard/deployment.

...

  1. yml

              wso2.status.dashboard:
              
    metricsDatasourceName: 'WSO2_METRICS_DB'
    dashboardDatasourceName: 'WSO2_STATUS_DASHBOARD_DB'

Configuring metrics

Configuring worker metrics

To enable metrics and to configure metric-related properties, do the following configurations in the <SP_HOME>/conf/worker/deployment.yaml

...

 file for the required nodes.

  1. To enable Carbon metrics, set the enabled

...

  1.  property to true

...

  1.  under wso2.metrics.
  2. Under wso2.metrics.jdbc, configure the following properties to operate the JDBC reporters.

    ParameterDefault ValueDescription
    dataSource&JDBC01
    dataSource > dataSourceNamejava:comp/env/jdbc/WSO2MetricsDBThe name of the datasource used to store metric data.
    dataSource > scheduledCleanup > enabledfalseIf this is set to true, metrics data stored in the database is cleared at a specific time interval as scheduled.
    dataSource > scheduledCleanup > daysToKeep7If scheduled clean-up

...

  1. of metric data is enabled, all metric data in the database that

...

  1. are older than the number of days specified in this parameter are deleted.
    dataSource > scheduledCleanup > scheduledCleanupPeriod86400This parameter specifies the time interval in seconds at which all metric data stored in the database must be cleared.
  2. Some JVM metrics are not enable by default. They have to enable by putting levels configuration under wso2.metrics namespace as below.

    wso2.metrics:

     # Enable Metrics

       enabled:  true

        jmx:

     

...

  1.      # Register MBean when initializing Metrics

...

  1.      registerMBean: true

     

...

  1.      # MBean Name

...

  1.      name: org.wso2.carbon:type=Metrics

...

  1.      # Metrics Levels are organized from most specific to least:

...

  1.      # OFF (most specific, no metrics)

...

  1.      # INFO

...

  1.      # DEBUG

...

  1.      # TRACE (least specific, a lot of data)

...

  1.      # ALL (least specific, all data)

     levels:

     

...

  1.      # The root level configured for Metrics

...

  1.      rootLevel: INFO

     

...

  1.      # Metric Levels

...

  1.      levels:

             jvm.buffers: 'OFF'

             jvm.class-loading: INFO

             jvm.gc: DEBUG

             jvm.memory: INFO

    Following are the default merics levels.
    • Class loading

      PropertyDefault LevelDescription
      jvm.class-loading.loaded.currentInfoThe gauge showing the number of classes currently loaded for the JVM.
      jvm.class-loading.loaded.current
      jvm.class-loading.unloaded.total


    • Garbage collector

      PropertyDefault LevelDescription
      jvm.gc.PS-MarkSweep.countDebugThe gauge for showing the garbage collection and memory usage. Monitoring this allows you to identify memory leaks and memory trash that have a negative impact on performance.
      jvm.gc.PS-MarkSweep.time
      jvm.gc.PS-MarkSweep.time
      jvm.gc.PS-Scavenge.time
    • Memory

      PropertyDefault LevelDescription
      metric.level.jvm.gcInfoThe gauge for showing the used and committed memory in WSO2 SP.
      jvm.memory.heap.committedInfoThe gauge for showing the used and committed heap in WSO2 SP.
      jvm.memory.heap.init
      jvm.memory.heap.max
      jvm.memory.heap.usage
      jvm.memory.non-heap.committedInfoThe gauge for showing the used code cache and used CMS Perm Gen in WSO2 SP.
      jvm.memory.non-heap.init
      jvm.memory.non-heap.max
      jvm.memory.non-heap.usage
      jvm.memory.non-heap.used
      jvm.memory.total.committedInfoThe gauge for showing the total memory currently available for the JVM.
      jvm.memory.total.init
      jvm.memory.total.max
      jvm.memory.total.used
      jvm.memory.poolsOff
      jvm.memory.poolsOff
    • Operating system load

      PropertyDefault LevelDescription

      jvm.os


      InfoThe gauge for showing the current load imposed by the JVM on the operating system.
      jvm.os.cpu.load.processInfo
      jvm.os.cpu.load.process
      jvm.os.system.load.average
    • Threads

      PropertyDefault LevelDescription
      jvm.threads.countDebugThe gauge for showing the number of active and idle threads currently available in the JVM thread pool.
      jvm.threads.daemon.countDebugThe gauge for showing the number of active daemon threads currently available in the JVM thread pool.
      jvm.threads.blocked.countOffThe gauge for showing the number of threads that are currently blocked in the JVM thread pool.
      jvm.threads.deadlock.countOffThe gauge for showing the number of threads that are currently deadlocked in the JVM thread pool.
      jvm.threads.new.countOffThe gauge for showing the number of new threads generated in the JVM thread pool.
      jvm.threads.runnable.countOffThe gauge for showing the number of runnable threads currently available in the JVM thread pool.
      jvm.threads.terminated.countOffThe gauge for showing the number of threads terminated from the JVM thread pool since user started running the WSO2 API Manager instance.
      jvm.threads.timed_waiting.countOffThe gauge for showing the number of threads in the Timed_Waiting state.
      jvm.threads.waiting.countOffThe gauge for showing the number of threads in the Waiting state in the JVM thread pool. One or more other threads are required to perform certain actions before these threads can proceed with their actions.
    • File descriptor details

      PropertyDefault LevelDescription
      file.descriptor.max.countINFOThe gauge for showing the number of open file descriptors and max file descriptors.
      file.descriptor.open.count
    • Swap space

      PropertyDefault LevelDescription
      swap.space.free.sizeINFOThe gauge for showing the amount of free and total swap space in bytes.
      swap.space.total.size


      Configuring app metrics

      To measure the the metrics of

...

    • the siddhi app you need to add

...

    • the following annotation to each siddhi app under appName.

      @App:name('TestMetrics')

      @app:statistics(reporter = 'jdbc')

      define stream TestStream (message string);

      Following metrics are

...

    • measured and all the metrics levels are INFO.

      Property

      Default Level after enabling metrics

      Components

      Latency

      INFO

      Windows(per window.find and window.add),Mapper((per sink mapper, source mapper),Query(per query),Table(per table insert, find, update, updateOrInsert, delete, contains )

      Throughput

      Triggers(per stream, trigger),Windows(per window.find and window.add),Source(per source),Sink(per source),Streams(per stream),Table(per table insert, find, update, updateOrInsert, delete, contains ),

      Memory

      Query(per query)

      Buffered Events Count


      No. of events at disruptor

      Streams(per stream)

      No. of events produced/Received after restart

      ource(per source),Sink(per source)

Configuring Cluster Credentials.

For accessing each node in the cluster you need to maintain share username and passwaord among cluster and shold include this username and password under <SP_HOME>/conf/dashboard/deployment.yml. For secure purpose you can use wso2 securevault for encrypt passwords. Please no that this is currently support single tenent.

      wso2.status.dashboard:
       
workerAccessCredentials:
username: 'admin'
password: 'admin'
How to use wso2 securevault:
      

Configuring Roles.

There are three permission levels in the Stream Processor monitoring application as follows,

  • SysAdmin : Grants system administration permission including enabling/disabling metrics in workers and view/add/delete workers
  • Developers: Grants permission to view/add/delete workers in the dashboard
  • Viewers: Grant permission to view works in the dashboard

By default adminrole in the userstore is assigned with SysAdmin permissions.


The following configurations must be added in the <SP_HOME>/conf/dashboard/deployment.yaml file, if different roles need be assigned the above permissions,

Code Block
languagexml
wso2.status.dashboard:
  sysAdminRoles:
	- role_1
  developerRoles:
	- role_2
  viewerRoles:
	- role_3
Info

The display name of the roles given in the configuration must be present in the user store. To configure user store check, User Management


Viewing the Status Dashboard
Anchor
View
View

To view the status dashboard, follow the procedure below:

  1. Start the dashboard for your worker node by issuing one of the following commands:
    For Windows: dashboard.bat 
    For Linux : ./dashboard.sh
  2. Access the Status Dashboard via the following URL format.

    https://localhost:<SP_DASHBOARD_PORT>/sp-status-dashboard

    e.g., https://0.0.0.0:9643/sp-status-dashboard

    After login this opens  the Status Dashboard with the nodes that you have already added as shown in the example below.
    Image Modified
    I
    f no nodes are displayed, add the nodes for which you wnt to view statistics by following the steps

...

  1. in Worker Overview - Adding a worker to the dashboard.

For a detailed descripion of each page in this dashboard, see the following topics:

Child pages (Children Display)