Prometheus und Grafana

Prometheus

Metrikabruf testen

Zum Testen des Abrufes von Metriken kann curl benutzt werden. Der AUTHTOKEN muss in der App konfiguriert werden:

curl \
  -k \
  -X GET \
  -H "Authorization: Bearer <AUTHTOKEN>" \
  https://<APPPLATFORM_HOSTNAME_OR_IP>/<DOMAIN>/<INSTANCE>/prometheus/metrics

Scrape Job

Damit Prometheus die Metriken der App abruft, muss ein Scrape Job eingerichtet werden. Das kann auf mehrere Arten vorgenommen werden. Hier ist ein Beispiel für einen Job in der Konfigurationsdatei prometheus.yml:

- job_name: 'innovaphone_<INSTANCE>'
  metrics_path: '/<DOMAIN>/<INSTANCE>/prometheus/metrics'
  authorization:
    type: Bearer
    credentials: <AUTHTOKEN>
  tls_config:
    insecure_skip_verify: false
  static_configs:
    - targets:
      - "<APPPLATFORM_HOSTNAME_OR_IP>"

Metriken

Übersicht über die aufgezeichneten Metriken

innovaphone_waitingqueue_status_sum

Gesamtanzahl an Status-Nachrichten der RCC-Api über Calls:

# HELP innovaphone_waitingqueue_status_sum Sum of call state messages
# TYPE innovaphone_waitingqueue_status_sum counter
innovaphone_waitingqueue_status_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="r-setup"} 22
innovaphone_waitingqueue_status_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="x-alert"} 22
innovaphone_waitingqueue_status_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="x-conn"} 22
innovaphone_waitingqueue_status_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="r-rel"} 22
innovaphone_waitingqueue_status_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="x-rel"} 22
innovaphone_waitingqueue_status_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="del"} 22

innovaphone_waitingqueue_duration_sum

Die Summe in Sekunden seit Anrufbeginn, in der die einzelnen Status-Nachrichten aufgetreten sind:

# HELP innovaphone_waitingqueue_duration_sum Sum of duration since call start by states in seconds
# TYPE innovaphone_waitingqueue_duration_sum counter
innovaphone_waitingqueue_duration_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="r-setup"} 0
innovaphone_waitingqueue_duration_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="x-alert"} 0
innovaphone_waitingqueue_duration_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="x-conn"} 330
innovaphone_waitingqueue_duration_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="r-rel"} 2689
innovaphone_waitingqueue_duration_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="x-rel"} 2689
innovaphone_waitingqueue_duration_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0",msg="del"} 2689

innovaphone_waitingqueue_calls_active

Jeweils aktuelle Gesamtanzahl der aktuell anstehenden Rufen:

# HELP innovaphone_waitingqueue_calls_active Sum of active calls
# TYPE innovaphone_waitingqueue_calls_active gauge
innovaphone_waitingqueue_calls_active{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0"} 0

innovaphone_waitingqueue_calls_duration_sum

Die Summe der Anrufdauer der aktuell anstehenden Rufe:

# HELP innovaphone_waitingqueue_calls_duration_sum Gauge sum of age of active calls in seconds
# TYPE innovaphone_waitingqueue_calls_duration_sum gauge
innovaphone_waitingqueue_calls_duration_sum{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",cn="WQ0"} 0

innovaphone_app_uptime

Die Zeit in Sekunden, seitdem die App-Instanz gestartet ist, also die Up-Time der App Instanz:

# HELP innovaphone_app_uptime Total number of seconds since app start in seconds
# TYPE innovaphone_app_uptime counter
innovaphone_app_uptime{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com"} 2789

innovaphone_app_info

Informationen über die Version der App. Version ist die Buildnummer:

# HELP innovaphone_app_info App Infos
# TYPE innovaphone_app_info gauge
innovaphone_app_info{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",version="7"} 7

innovaphone_app_httpserver_requests_total

Die App stellt einen Webserver für den Abruf der Metriken bereit. Diese Metrik zählt alle eingehenden Anfragen:

# HELP innovaphone_app_httpserver_requests_total Total number of handled, incoming http requests since app start
# TYPE innovaphone_app_httpserver_requests_total counter
innovaphone_app_httpserver_requests_total{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com"} 1498

innovaphone_app_httpserver_requestmethod_total

Die Anzahl an eingehenden HTTP-Anfragen auf dem Webserver der App aufgeschlüsselt nach der HTTP-Method:

# HELP innovaphone_app_httpserver_requestmethod_total Total number of handled, incoming http requests by request method since app start
# TYPE innovaphone_app_httpserver_requestmethod_total counter
innovaphone_app_httpserver_requestmethod_total{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",method="GET"} 1498

innovaphone_app_httpserver_requestmethod_total

Die Anzahl an eingehenden HTTP-Anfragen auf dem Webserver der App aufgeschlüsselt nach dem Pfad und dem HTTP-Response-Code:

# HELP innovaphone_app_httpserver_responsecode_total Total number of responses by requestpath and statuscode
# TYPE innovaphone_app_httpserver_responsecode_total counter
innovaphone_app_httpserver_responsecode_total{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",path="/metrics",statuscode="200"} 1494

innovaphone_app_connections_users

Anzahl an Websocket-Verbindungen von User:innen der App in dem App-Service:

# HELP innovaphone_app_connections_users Total number of connected user sockets
# TYPE innovaphone_app_connections_users gauge
innovaphone_app_connections_users{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com"} 1

innovaphone_app_connections_admins

Anzahl an Websocket-Verbindungen von Admins der App in dem App-Service:

# HELP innovaphone_app_connections_admins Total number of connected admin sockets
# TYPE innovaphone_app_connections_admins gauge
innovaphone_app_connections_admins{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com"} 1

innovaphone_app_connected_apis

Anzahl an Websocket-Verbindungen von PBX-APIs in dem App-Service aufgeschlüsselt nach Domain, PBX und API:

# HELP innovaphone_app_connected_apis Number of connected api sockets
# TYPE innovaphone_app_connected_apis gauge
innovaphone_app_connected_apis{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",pbxdns="pbx.company.com",api="RCC"} 1

innovaphone_group_member_states

Anzahl an Mitgliedern in einer Gruppe bzw. die Anzahl an Mitgliedern mit dem jeweiligem Gruppenstatus:

# HELP innovaphone_group_member_states State of the members of a group
# TYPE innovaphone_group_member_states gauge
innovaphone_group_member_states{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",group="Support",state="all"} 11
innovaphone_group_member_states{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",group="Support",state="in"} 6
innovaphone_group_member_states{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",group="Support",state="out"} 4
innovaphone_group_member_states{serviceid="trizwo-wqstatus",servicedns="apps.company.com",instance="wqstatuskundensupport",domain="company.com",pbx="pbx-main",group="Support",state="static"} 1

Grafana

Dashboard

Ein Beispiel Dashboard kann importiert werden.