list
logo
Please be aware that there is newer version of documentation available for Webswing. Documentation 26.2

Monitoring

Monitoring endpoints are part of the Admin Console REST interface.

REST API

To enable monitoring "rest user" with "rest_getMetrics" permission must be added to the webswing.config file.

For example:

{
  "/" : {
    "path" : "/",
    "restUsers": [
      {
        "permissions": [
          "rest_getMetrics"
        ],
        "password": "pwd",
        "username": "rest_user"
      }
    ]
  }
}

Services

There are 3 rest services:

Name Description Parameters to be monitored
1. /rest/metrics/app Info about connected, disconnected, idle and total applications and their stats ws_app_count
ws_app_total_count
ws_app_memoryUsed_percent
ws_app_cpuUtilization_percent
ws_app_latency_second
ws_app_latencyNetworkTransfer_second
2. /rest/metrics/sp Info about connected, disconnected, idle and total applications ws_sp_apps_count
ws_sp_apps_total_count
3. /rest/metrics Info about cluster server, session pools and their stats ws_overview_basic_stats_count
ws_overview_server_stats_count
ws_overview_server_flasg_info
ws_overview_sp_stats_count
ws_overview_server_flags_info
ws_overview_count

These services can be found in the file:

\webswing-home\webswing-admin\webswing-admin-server\src\main\resources\openapi\webswing_api.yaml

Metrics list

Name Description Labels
1. ws_app_count Informations about applications app: "Application name"
state: "connected, disconnected, idle, total"
2. ws_app_total_count Sum informations about applications state: "connected, disconnected, idle, total"
3. ws_app_memoryUsed_percent Memory used for application in percent app: "Application name"
aggr: "MIN, MAX, AVG"
4. ws_app_cpuUtilization_percent CPU utilization for application in percent app: "Application name"
aggr: "MIN, MAX, AVG"
5. ws_app_latency_second Latency in seconds app: "Application name"
aggr: "MIN, MAX, AVG"
6. ws_app_latencyNetworkTransfer_second Latency network transfer in seconds app: "Application name"
aggr: "MIN, MAX, AVG"
7. ws_sp_apps_count Informations about sessionpools sessionpool: "Sessionpool ID"
app: "Application name"
state: "connected, disconnected, idle, total"
8. ws_sp_apps_total_count Sum informations about sessionpools sessionpool: "Sessionpool ID"
state: "connected, disconnected, idle, total"
9. ws_overview_basic_stats_count Informations about basic stats flag:
10. ws_overview_server_stats_count Informations about servers server: "Server name"
flag: "session_pool, available_apps, running_apps, active_users, sessions, sessions_connected, connections"
11. ws_overview_server_flags_info Informations about servers server: "Server name"
flag: "verbose_logging"
12. ws_overview_sp_stats_count Informations about sessionpools sessionpool: "Sessionpool ID"
flag: "available_apps, running_apps, connected_servers, idle_apps, max_instances, max_idle_instances, priority"
13. ws_overview_sp_flags_info Informations about sessionpools sessionpool: "Sessionpool ID"
flag: "drain_mode, drain_auto_mode, static_sp, verbose_logging"
14. ws_overview_count Informations about servers and sessionpools flag: "active_servers", "active_sp"

Prometheus

To use this with Prometheus, you must add jobs to your prometheus.yml file.

Here is a docker example:

docker-compose.yml

  prometheus:
    image: prom/prometheus:v3.1.0
    container_name: prometheus
    depends_on:
      - adminconsole
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"

prometheus.yml

global:
  scrape_interval: 30s
  
scrape_configs:
  - job_name: 'ws-metrics-app'
    metrics_path: '/rest/metrics/app'
    basic_auth:
      username: 'rest_user'
      password: 'pwd'
    static_configs:
      - targets: 
        - 'host.docker.internal:8083'
  - job_name: 'ws-metrics-sp'
    metrics_path: '/rest/metrics/sp'
    basic_auth:
      username: 'rest_user'
      password: 'pwd'
    static_configs:
      - targets: 
        - 'host.docker.internal:8083'
  - job_name: 'ws-metrics'
    metrics_path: '/rest/metrics'
    basic_auth:
      username: 'rest_user'
      password: 'pwd'
    static_configs:
      - targets: 
        - 'host.docker.internal:8083'

Grafana

Creating a Prometheus data source

Creating a Prometheus graph