logo
25.1
search
No matching documents found.
list
search
No matching documents found.
logo

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 app_count
app_total_count
app_memoryUsed_percent
app_cpuUtilization_percent
app_latency_second
app_latencyNetworkTransfer_second
2. /rest/metrics/sp Info about connected, disconnected, idle and total applications sp_apps_count
sp_apps_total_count
3. /rest/metrics Info about cluster server, session pools and their stats overview_basic_stats_count
overview_server_stats_count
overview_server_flasg_info
overview_sp_stats_count
overview_server_flags_info
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. app_count Informations about applications app: "Application name"
state: "connected, disconnected, idle, total"
2. app_total_count Sum informations about applications state: "connected, disconnected, idle, total"
3. app_memoryUsed_percent Memory used for application in percent app: "Application name"
aggr: "MIN, MAX, AVG"
4. app_cpuUtilization_percent CPU utilization for application in percent app: "Application name"
aggr: "MIN, MAX, AVG"
5. app_latency_second Latency in seconds app: "Application name"
aggr: "MIN, MAX, AVG"
6. app_latencyNetworkTransfer_second Latency network transfer in seconds app: "Application name"
aggr: "MIN, MAX, AVG"
7. sp_apps_count Informations about sessionpools sessionpool: "Sessionpool ID"
app: "Application name"
state: "connected, disconnected, idle, total"
8. sp_apps_total_count Sum informations about sessionpools sessionpool: "Sessionpool ID"
state: "connected, disconnected, idle, total"
9. overview_basic_stats_count Informations about basic stats flag:
10. overview_server_stats_count Informations about servers server: "Server name"
flag: "session_pool, available_apps, running_apps, active_users, sessions, sessions_connected, connections"
11. overview_server_flags_info Informations about servers server: "Server name"
flag: "verbose_logging"
12. 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. overview_sp_flags_info Informations about sessionpools sessionpool: "Sessionpool ID"
flag: "drain_mode, drain_auto_mode, static_sp, verbose_logging"
14. 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