diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed2d93b56..2faa871cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -471,30 +471,6 @@ and if not found, tries to download wheel from PyPI. Use top level `make dist` to generate wheels. -## Testing with Grafana - -temBoard exposes /metrics in OpenMetric format. Development environment -includes Prometheus and Grafana preconfigured with authenticated access and -file-based service discovery. You only need a couple of steps to view temBoard -metrics in Grafana. - -- Start development temBoard UI and at lease one of agent0 or agent1. -- Generate Prometheus targets using `make prom-targets`. -- Go to [development Grafana import page](http://localhost:3000/dashboard/import). -- Import Dashboard ID [1860](https://grafana.com/grafana/dashboards/1860) - (*Node Exporter Full*) or [9628](https://grafana.com/grafana/dashboards/1860) - (*PostgreSQL Database*). -- Now wait a few minutes that Prometheus scrapes data. Scrape interval is 1 - minute. - -temBoard exposes only a subset of metrics from node\_exporter and -postgres\_exporter, plus a set of custom metrics prefixed with `x`, e.g. -`xpg_wal_files_bytes_total`. Thus a lot of panel will show *N/A*. - -Prometheus also watch `dev/prometheus/targets/custom.yaml` files for hand -written targets. - - ## Investigate logs with lnav [lnav] is an awesome tool to browse and analyze log files. diff --git a/Makefile b/Makefile index 0a92a32ba..2cff569f4 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ ui/build/bin/prometheus ui/build/bin/promtool: dev/downloads/prometheus-$(PROMET clean: #: Trash venv and containers. docker compose down --volumes --remove-orphans docker rmi --force dalibo/temboard-agent:dev - rm -rf dev/venv-py* .venv-py* dev/build/ dev/prometheus/targets/temboard-dev.yaml + rm -rf dev/venv-py* .venv-py* dev/build/ rm -vf ui/build/bin/prometheus ui/build/bin/promtool rm -rf agent/build/ .env agent/.coverage rm -rvf ui/build/ ui/.coverage @@ -128,10 +128,6 @@ tests: #: Execute all tests. clean-tests: #: Clean tests runtime files rm -rf tests/downloads/ tests/logs/ tests/screenshots/ -prom-targets: dev/prometheus/targets/temboard-dev.yaml #: Generate Prometheus dev targets. -dev/prometheus/targets/temboard-dev.yaml: dev/bin/mktargets .env - $^ > $@ - VERSION=$(shell cd ui; python3 setup.py --version) BRANCH?=master # When stable branch v8 is created, use this: diff --git a/dev/bin/mktargets b/dev/bin/mktargets deleted file mode 100755 index fa7b0908e..000000000 --- a/dev/bin/mktargets +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -eu - -# shellcheck source=/dev/null -. .env - -target="${TEMBOARD_UI_URL#https://}" - -cat <<-EOF -- targets: - - $target - labels: - __metrics_path__: /proxy/0.0.0.0/2345/monitoring/metrics - instance: "postgres0.dev:5432" - # For PostgreSQL Database dashboard #9628 - kubernetes_namespace: nok8s - release: norelease -- targets: - - $target - labels: - __metrics_path__: /proxy/0.0.0.0/2346/monitoring/metrics - instance: "postgres1.dev:5432" - kubernetes_namespace: nok8s - release: norelease -EOF diff --git a/dev/grafana/rootfs/etc/grafana/provisioning/dashboards/perf.yaml b/dev/grafana/rootfs/etc/grafana/provisioning/dashboards/perf.yaml index 7bf753ee0..3abb04797 100644 --- a/dev/grafana/rootfs/etc/grafana/provisioning/dashboards/perf.yaml +++ b/dev/grafana/rootfs/etc/grafana/provisioning/dashboards/perf.yaml @@ -7,15 +7,3 @@ providers: allowUiUpdates: true options: path: /usr/share/temboard/perf.json -- name: "Postgres from temBoard agent" - type: file - folder: '' - allowUiUpdates: true - options: - path: /usr/share/temboard/postgres.json -- name: "temBoard Prometheus" - type: file - folder: '' - allowUiUpdates: true - options: - path: /usr/share/temboard/temboard-prometheus.json diff --git a/dev/grafana/rootfs/usr/share/temboard/postgres.json b/dev/grafana/rootfs/usr/share/temboard/postgres.json deleted file mode 100644 index 3bbabc85e..000000000 --- a/dev/grafana/rootfs/usr/share/temboard/postgres.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 2, - "iteration": 1643970369705, - "links": [], - "liveNow": false, - "panels": [ - { - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 50, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "multi" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "01lWBBhnk" - }, - "exemplar": true, - "expr": "sum(rate(xacts_n_commit{logfile=\"$logfile\"}[5m]))", - "interval": "", - "legendFormat": "commit", - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "01lWBBhnk" - }, - "exemplar": true, - "expr": "sum(rate(xacts_n_rollback{logfile=\"$logfile\"}[5m]))", - "hide": false, - "interval": "", - "legendFormat": "rollback", - "refId": "B" - } - ], - "title": "TPS", - "type": "timeseries" - }, - { - "datasource": { - "type": "loki", - "uid": "j1tzJKb7k" - }, - "gridPos": { - "h": 13, - "w": 24, - "x": 0, - "y": 7 - }, - "id": 2, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Ascending", - "wrapLogMessage": false - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "j1tzJKb7k" - }, - "expr": "{logfile=~\"$logfile\"}", - "refId": "A" - } - ], - "title": "Messages", - "type": "logs" - } - ], - "refresh": false, - "schemaVersion": 33, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": ".+", - "value": ".+" - }, - "definition": "label_values(logfile)", - "hide": 0, - "includeAll": false, - "multi": false, - "name": "logfile", - "options": [], - "query": { - "query": "label_values(logfile)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "type": "query" - } - ] - }, - "time": { - "from": "now-3h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Postgres", - "uid": "gQ7FEi-7z", - "version": 3, - "weekStart": "" -} diff --git a/dev/grafana/rootfs/usr/share/temboard/temboard-prometheus.json b/dev/grafana/rootfs/usr/share/temboard/temboard-prometheus.json deleted file mode 100644 index 7ad8c801d..000000000 --- a/dev/grafana/rootfs/usr/share/temboard/temboard-prometheus.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 3, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "Kme6NfMSz" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "Kme6NfMSz" - }, - "editorMode": "builder", - "expr": "node_load1", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Panel Title", - "type": "timeseries" - } - ], - "schemaVersion": 36, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "temBoard Prometheus", - "uid": "aC9VOfMSk", - "version": 1, - "weekStart": "" -} diff --git a/docker-compose.yml b/docker-compose.yml index febc6d80b..0f629ec7f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -214,7 +214,6 @@ services: volumes: - ./dev/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml - ./dev/prometheus/import:/import - - ./dev/prometheus/targets:/targets ports: - 9090:9090 command: