In dieser Anleitung zeige ich euch, wie ihr in Grafana Statistiken über euren Jitsi Meet Server anzeigen könnt. Das alles wird unter Docker realisiert.
Wichtiger Hinweis
Diese Anleitung basiert auf meiner Anleitung von Grafana und der Anleitung zu Jitsi. Wenn ihr nicht meine Anleitungen genutzt habt, dann könnt ihr diese Befehle NICHT 1:1 kopieren. Ihr müsst dann auf jeden Fall einiges anpassen.
0. Voraussetzungen
Wie bereits erwähnt basiert diese Anleitung auf meiner Anleitung zu Grafana sowie meiner Anleitung zu Jitsi. Also bitte übernehmt den Code nur 1:1, wenn ihr meine Anleitungen genutzt habt.
1. Anpassungen an Grafana
Zuerst beenden wir Grafana.
docker-compose -f /opt/containers/grafana/docker-compose.yml down
1.1 Docker-Compose anpassen
Anschließend müssen wir Grafana etwas anpassen, damit die Jitsi Daten gesammelt werden. Dazu öffnet ihr folgende Datei:
nano /opt/containers/grafana/docker-compose.yml
Nun fügt ihr folgenden Service hinzu:
mon_jitsi: container_name: mon_jitsi image: karrieretutor/jitsi:prom-exporter-latest restart: unless-stopped env_file: .env networks: - default - jitsi_meet.jitsi
Am Ende der Datei fügt ihr folgendes hinzu:
networks: proxy: external: true jitsi_meet.jitsi: external: true
Nun sollte eure Docker Compose so aussehen:
version: '3' services: mon_jitsi: container_name: mon_jitsi image: karrieretutor/jitsi:prom-exporter-latest restart: unless-stopped env_file: .env networks: - default - jitsi_meet.jitsi mon_prometheus: image: prom/prometheus:latest container_name: mon_prometheus restart: unless-stopped . . . networks: proxy: external: true jitsi_meet.jitsi: external: true
1.2 prometheus.yml anpassen
Nun passen wir die Datei prometheus.yml an.
nano /opt/containers/grafana/prometheus/prometheus.yml
Hier fügt ihr folgendes hinzu:
- job_name: 'jitsi-exporter' scrape_interval: 5s static_configs: - targets: ['mon_jitsi:8080']
Bei mir sieht es dann so aus:
global: scrape_interval: 15s evaluation_interval: 15s . . . - job_name: 'cadvisor' static_configs: - targets: ['mon_cadvisor:8080'] - job_name: 'jitsi-exporter' scrape_interval: 5s static_configs: - targets: ['mon_jitsi:8080']
1.3 env Datei erstellen
Nun müssen wir noch eine Datei erstellen, in welcher die Zugangsdaten für unseren “Statistik Benutzer” stehen.
nano /opt/containers/grafana/.env
Inhalt:
XMPP_USER=prometheus XMPP_PW=sicheresPasswort XMPP_SERVER=xmpp.meet.jitsi XMPP_PORT=5222 XMPP_AUTH_DOMAIN=auth.meet.jitsi XMPP_INTERNAL_MUC_DOMAIN=internal-muc.meet.jitsi
Hier müsst ihr das XMPP_PW Kennwort ändern.
1.4 Benutzer in Jitsi anlegen
Nun müssen wir noch diesen Benutzer in Jitsi anlegen. Wichtig ist, dass Jitsi bereits gestartet sein muss. Dazu gebt ihr folgendes ein:
docker exec jitsi_prosody_1 prosodyctl --config /config/prosody.cfg.lua register prometheus auth.meet.jitsi sicheresPasswort
Hier müsst ihr das Kennwort verwenden, welches ihr im Schritt zuvor vergeben habt.
Wichtig
Dieser Benutzer existiert nur so lange, wie ihr eure Konfigurationsdateien nicht löscht. Dies müsst ihr aber beispielsweise bei jedem Jitsi Update machen.
2. Grafana starten
Nun können wir Grafana wieder starten.
docker-compose -f /opt/containers/grafana/docker-compose.yml up -d
Nun geht ihr auf euer Grafana Webinterface (Beispiel: grafana.euredomain.de).
Klickt nun auf das “+” und wählt nun “Import” aus.
Nun sollte dieses Fenster erscheinen:
In den Bereich “Import via panel json” kopiert ihr folgenden Code:
{ "annotations": { "list": [ { "builtIn": 1, "datasource": "Prometheus", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "limit": 100, "name": "Annotations & Alerts", "showIn": 0, "type": "dashboard" } ] }, "editable": true, "gnetId": null, "graphTooltip": 1, "id": 3, "links": [], "panels": [ { "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {}, "decimals": 0, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 40 }, { "color": "red", "value": 60 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 0, "y": 0 }, "hideTimeOverride": true, "id": 6, "interval": "10s", "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "mean" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "7.3.6", "targets": [ { "expr": "conferences", "instant": true, "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": "1m", "timeShift": "10s", "title": "Aktuelle Konferenzen", "type": "stat" }, { "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {}, "decimals": 0, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 240 }, { "color": "red", "value": 360 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 3, "y": 0 }, "hideTimeOverride": true, "id": 8, "interval": "10s", "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "mean" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "7.3.6", "targets": [ { "expr": "participants", "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": "1m", "timeShift": "10s", "title": "Aktuelle Teilnehmer", "type": "stat" }, { "cacheTimeout": null, "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "displayName": "", "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 6, "y": 0 }, "id": 28, "links": [], "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "last" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": false }, "pluginVersion": "7.3.6", "targets": [ { "expr": "100 - (avg by (cpu) (irate(node_cpu_seconds_total{mode=\"idle\"}[1m])) *100)", "hide": false, "interval": "", "legendFormat": "", "refId": "A" }, { "expr": "(irate(node_cpu_seconds_total{mode=\"idle\"}[1m])) ", "hide": true, "interval": "", "legendFormat": "", "refId": "B" } ], "timeFrom": null, "timeShift": null, "title": "CPU Auslastung", "type": "gauge" }, { "cacheTimeout": null, "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {}, "decimals": 0, "mappings": [ { "id": 0, "op": "=", "text": "N/A", "type": 1, "value": "null" } ], "max": 100, "min": 0, "nullValueMode": "connected", "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 70 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 6, "w": 4, "x": 14, "y": 0 }, "id": 30, "links": [], "options": { "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "7.3.6", "targets": [ { "expr": "((node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) / node_memory_MemTotal_bytes) * 100 ", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "", "refId": "A", "step": 1800 } ], "timeFrom": null, "timeShift": null, "title": "RAM Auslastung", "type": "gauge" }, { "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {}, "decimals": 2, "mappings": [], "max": 1000000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 800000 } ] }, "unit": "Kbits" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 18, "y": 0 }, "hideTimeOverride": true, "id": 22, "interval": "10s", "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "last" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "7.3.6", "targets": [ { "expr": "bit_rate_upload", "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": "1m", "timeShift": "10s", "title": "Ausgehender Datenverkehr", "type": "gauge" }, { "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {}, "decimals": 2, "mappings": [], "max": 1000000, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 800000 } ] }, "unit": "Kbits" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 21, "y": 0 }, "hideTimeOverride": true, "id": 14, "interval": "10s", "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "last" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "7.3.6", "targets": [ { "expr": "bit_rate_download", "interval": "", "legendFormat": "", "refId": "A" } ], "timeFrom": "1m", "timeShift": "10s", "title": "Eingehender Datenverkehr", "type": "gauge" }, { "aliasColors": { "Conferences": "dark-orange" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus", "decimals": 0, "fieldConfig": { "defaults": { "custom": {}, "links": [] }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 11, "w": 12, "x": 0, "y": 6 }, "hiddenSeries": false, "hideTimeOverride": true, "id": 2, "interval": "10s", "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": false, "show": true, "sort": "current", "sortDesc": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "alertThreshold": true }, "percentage": false, "pluginVersion": "7.3.6", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [ { "alias": "jvb", "color": "#73BF69", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 }, { "alias": "jvb2", "color": "#FADE2A", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 }, { "alias": "Conferences total", "color": "#FA6400" }, { "alias": "jvb3", "color": "#B877D9", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 } ], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "conferences", "interval": "", "legendFormat": "Conferences total", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": "10s", "title": "Konferenzen", "tooltip": { "shared": true, "sort": 2, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": 0, "format": "short", "label": null, "logBase": 1, "max": null, "min": "0", "show": true }, { "decimals": 0, "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Participants": "dark-red" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus", "decimals": 0, "fieldConfig": { "defaults": { "custom": {}, "links": [] }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 11, "w": 12, "x": 12, "y": 6 }, "hiddenSeries": false, "hideTimeOverride": true, "id": 10, "interval": "10s", "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": false, "show": true, "sort": "current", "sortDesc": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "alertThreshold": true }, "percentage": false, "pluginVersion": "7.3.6", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [ { "alias": "jvb", "color": "#73BF69", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 }, { "alias": "jvb2", "color": "#FADE2A", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 }, { "alias": "Participants total", "color": "#C4162A" }, { "alias": "jvb3", "color": "#B877D9", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 } ], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "participants", "interval": "", "legendFormat": "Participants total", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": "10s", "title": "Teilnehmer", "tooltip": { "shared": true, "sort": 2, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": 0, "format": "short", "label": null, "logBase": 1, "max": null, "min": "0", "show": true }, { "decimals": 0, "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "Videochannels": "dark-blue" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus", "decimals": 0, "fieldConfig": { "defaults": { "custom": {}, "links": [] }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 11, "w": 12, "x": 0, "y": 17 }, "hiddenSeries": false, "hideTimeOverride": true, "id": 4, "interval": "10s", "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": false, "show": true, "sort": "current", "sortDesc": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "alertThreshold": true }, "percentage": false, "pluginVersion": "7.3.6", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [ { "alias": "jvb", "color": "#73BF69", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 }, { "alias": "jvb2", "color": "#FADE2A", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 }, { "alias": "Videochannels total", "color": "#1F60C4" }, { "alias": "jvb3", "color": "#B877D9", "dashLength": 3, "dashes": true, "fill": 0, "spaceLength": 3 } ], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "videochannels", "interval": "", "legendFormat": "Videochannels total", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": "10s", "title": "Videokanäle", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": 0, "format": "none", "label": null, "logBase": 1, "max": null, "min": "0", "show": true }, { "format": "none", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": { "In": "dark-green", "Out": "dark-yellow" }, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus", "fieldConfig": { "defaults": { "custom": {}, "links": [] }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 11, "w": 12, "x": 12, "y": 17 }, "hiddenSeries": false, "id": 12, "legend": { "alignAsTable": true, "avg": true, "current": true, "max": true, "min": false, "rightSide": false, "show": true, "sort": "current", "sortDesc": true, "total": false, "values": true }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "alertThreshold": true }, "percentage": false, "pluginVersion": "7.3.6", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [ { "alias": "Out", "transform": "negative-Y" } ], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "bit_rate_download", "interval": "", "legendFormat": "In", "refId": "A" }, { "expr": "bit_rate_upload", "interval": "", "legendFormat": "Out", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Netzwerk Auslastung", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "Kbits", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "bps", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } } ], "refresh": "10s", "schemaVersion": 26, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": { "nowDelay": "", "refresh_intervals": [ "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ] }, "timezone": "", "title": "Jitsi Meet", "uid": "000000022", "version": 5 }
Nun klickt ihr “Load”
Jetzt bestätigt ihr noch mit “Import”.
Wenn alles funktioniert hat, sollte es nun so aussehen:
3. Quellen
https://adminforge.de/tools/jitsi-meet-grafana-statistiken-docker/
Erstmal vielen Dank für die guten Anleitungen hier, aber die jitsi meet Statistiken bekomme ich nach deiner Anleitung leider nicht in grafana. So wie es aussieht gibt es dieses Image nicht mehr “karrieretutor/jitsi:prom-exporter-latest”.
“ERROR: The image for the service you’re trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.”
Gruß