From 65acf13e6f25f31659543d04fbb7cd1eaae01266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Tue, 17 Feb 2026 22:23:04 +0100 Subject: [PATCH] grafana: fix datasource UIDs for VictoriaMetrics migration Update all dashboard datasource references from "prometheus" to "victoriametrics" to match the declared datasource UID. Enable prune and deleteDatasources to clean up the old Prometheus (monitoring01) datasource from Grafana's database. Co-Authored-By: Claude Opus 4.6 --- services/grafana/dashboards/apiary.json | 20 ++++---- services/grafana/dashboards/certificates.json | 20 ++++---- services/grafana/dashboards/nixos-fleet.json | 48 +++++++++---------- .../grafana/dashboards/node-exporter.json | 16 +++---- services/grafana/dashboards/proxmox.json | 28 +++++------ services/grafana/dashboards/systemd.json | 26 +++++----- services/grafana/dashboards/temperature.json | 14 +++--- services/grafana/default.nix | 4 ++ 8 files changed, 90 insertions(+), 86 deletions(-) diff --git a/services/grafana/dashboards/apiary.json b/services/grafana/dashboards/apiary.json index 6fa4297..9899ccb 100644 --- a/services/grafana/dashboards/apiary.json +++ b/services/grafana/dashboards/apiary.json @@ -19,7 +19,7 @@ "title": "SSH Connections", "type": "stat", "gridPos": {"h": 4, "w": 6, "x": 0, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(oubliette_ssh_connections_total{job=\"apiary\"})", @@ -51,7 +51,7 @@ "title": "Active Sessions", "type": "stat", "gridPos": {"h": 4, "w": 6, "x": 6, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "oubliette_sessions_active{job=\"apiary\"}", @@ -86,7 +86,7 @@ "title": "Unique IPs", "type": "stat", "gridPos": {"h": 4, "w": 6, "x": 12, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "oubliette_storage_unique_ips{job=\"apiary\"}", @@ -118,7 +118,7 @@ "title": "Total Login Attempts", "type": "stat", "gridPos": {"h": 4, "w": 6, "x": 18, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "oubliette_storage_login_attempts_total{job=\"apiary\"}", @@ -150,7 +150,7 @@ "title": "SSH Connections Over Time", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "interval": "60s", "targets": [ { @@ -183,7 +183,7 @@ "title": "Auth Attempts Over Time", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "interval": "60s", "targets": [ { @@ -216,7 +216,7 @@ "title": "Sessions by Shell", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 22}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "interval": "60s", "targets": [ { @@ -249,7 +249,7 @@ "title": "Attempts by Country", "type": "geomap", "gridPos": {"h": 10, "w": 24, "x": 0, "y": 12}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "oubliette_auth_attempts_by_country_total{job=\"apiary\"}", @@ -318,7 +318,7 @@ "title": "Session Duration Distribution", "type": "heatmap", "gridPos": {"h": 8, "w": 24, "x": 0, "y": 30}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "interval": "60s", "targets": [ { @@ -359,7 +359,7 @@ "title": "Commands Executed by Shell", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 22}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "interval": "60s", "targets": [ { diff --git a/services/grafana/dashboards/certificates.json b/services/grafana/dashboards/certificates.json index 5cf0a22..619f058 100644 --- a/services/grafana/dashboards/certificates.json +++ b/services/grafana/dashboards/certificates.json @@ -16,7 +16,7 @@ "title": "Endpoints Monitored", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 0, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(probe_ssl_earliest_cert_expiry{job=\"blackbox_tls\"})", @@ -48,7 +48,7 @@ "title": "Probe Failures", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 4, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(probe_success{job=\"blackbox_tls\"} == 0) or vector(0)", @@ -82,7 +82,7 @@ "title": "Expiring Soon (< 7d)", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 8, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count((probe_ssl_earliest_cert_expiry{job=\"blackbox_tls\"} - time()) < 86400 * 7) or vector(0)", @@ -116,7 +116,7 @@ "title": "Expiring Critical (< 24h)", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 12, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count((probe_ssl_earliest_cert_expiry{job=\"blackbox_tls\"} - time()) < 86400) or vector(0)", @@ -150,7 +150,7 @@ "title": "Minimum Days Remaining", "type": "gauge", "gridPos": {"h": 4, "w": 8, "x": 16, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "min((probe_ssl_earliest_cert_expiry{job=\"blackbox_tls\"} - time()) / 86400)", @@ -187,7 +187,7 @@ "title": "Certificate Expiry by Endpoint", "type": "table", "gridPos": {"h": 12, "w": 12, "x": 0, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "(probe_ssl_earliest_cert_expiry{job=\"blackbox_tls\"} - time()) / 86400", @@ -253,7 +253,7 @@ "title": "Probe Status", "type": "table", "gridPos": {"h": 12, "w": 12, "x": 12, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "probe_success{job=\"blackbox_tls\"}", @@ -340,7 +340,7 @@ "title": "Certificate Expiry Over Time", "type": "timeseries", "gridPos": {"h": 8, "w": 24, "x": 0, "y": 16}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "(probe_ssl_earliest_cert_expiry{job=\"blackbox_tls\"} - time()) / 86400", @@ -378,7 +378,7 @@ "title": "Probe Success Rate", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 24}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "avg(probe_success{job=\"blackbox_tls\"}) * 100", @@ -418,7 +418,7 @@ "title": "Probe Duration", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 24}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "probe_duration_seconds{job=\"blackbox_tls\"}", diff --git a/services/grafana/dashboards/nixos-fleet.json b/services/grafana/dashboards/nixos-fleet.json index 722d5dd..4bfb3be 100644 --- a/services/grafana/dashboards/nixos-fleet.json +++ b/services/grafana/dashboards/nixos-fleet.json @@ -15,7 +15,7 @@ { "name": "tier", "type": "query", - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "query": "label_values(nixos_flake_info, tier)", "refresh": 2, "includeAll": true, @@ -30,7 +30,7 @@ "title": "Hosts Behind Remote", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 0, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(nixos_flake_revision_behind{tier=~\"$tier\"} == 1)", @@ -65,7 +65,7 @@ "title": "Hosts Needing Reboot", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 4, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(nixos_config_mismatch{tier=~\"$tier\"} == 1)", @@ -100,7 +100,7 @@ "title": "Total Hosts", "type": "stat", "gridPos": {"h": 4, "w": 3, "x": 8, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(nixos_flake_info{tier=~\"$tier\"})", @@ -128,7 +128,7 @@ "title": "Nixpkgs Age", "type": "stat", "gridPos": {"h": 4, "w": 3, "x": 11, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "max(nixos_flake_input_age_seconds{input=\"nixpkgs\", tier=~\"$tier\"})", @@ -163,7 +163,7 @@ "title": "Hosts Up-to-date", "type": "stat", "gridPos": {"h": 4, "w": 3, "x": 14, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(nixos_flake_revision_behind{tier=~\"$tier\"} == 0)", @@ -192,7 +192,7 @@ "title": "Deployments (24h)", "type": "stat", "gridPos": {"h": 4, "w": 3, "x": 17, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(increase(homelab_deploy_deployments_total{status=\"completed\"}[24h]))", @@ -222,7 +222,7 @@ "title": "Avg Deploy Time", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 20, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(increase(homelab_deploy_deployment_duration_seconds_sum{success=\"true\"}[24h])) / sum(increase(homelab_deploy_deployment_duration_seconds_count{success=\"true\"}[24h]))", @@ -256,7 +256,7 @@ "title": "Fleet Status", "type": "table", "gridPos": {"h": 10, "w": 24, "x": 0, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "nixos_flake_info{tier=~\"$tier\"}", @@ -430,7 +430,7 @@ "title": "Generation Age by Host", "type": "bargauge", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 14}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sort_desc(nixos_generation_age_seconds{tier=~\"$tier\"})", @@ -467,7 +467,7 @@ "title": "Generations per Host", "type": "bargauge", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 14}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sort_desc(nixos_generation_count{tier=~\"$tier\"})", @@ -501,7 +501,7 @@ "title": "Deployment Activity (Generation Age Over Time)", "type": "timeseries", "gridPos": {"h": 8, "w": 24, "x": 0, "y": 22}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "nixos_generation_age_seconds{tier=~\"$tier\"}", @@ -534,7 +534,7 @@ "title": "Flake Input Ages", "type": "table", "gridPos": {"h": 6, "w": 12, "x": 0, "y": 30}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "max by (input) (nixos_flake_input_age_seconds)", @@ -577,7 +577,7 @@ "title": "Hosts by Revision", "type": "piechart", "gridPos": {"h": 6, "w": 6, "x": 12, "y": 30}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count by (current_rev) (nixos_flake_info{tier=~\"$tier\"})", @@ -601,7 +601,7 @@ "title": "Hosts by Tier", "type": "piechart", "gridPos": {"h": 6, "w": 6, "x": 18, "y": 30}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count by (tier) (nixos_flake_info)", @@ -641,7 +641,7 @@ "title": "Builds (24h)", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 0, "y": 37}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(increase(homelab_deploy_build_host_total{status=\"success\"}[24h]))", @@ -671,7 +671,7 @@ "title": "Failed Builds (24h)", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 4, "y": 37}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(increase(homelab_deploy_build_host_total{status=\"failure\"}[24h])) or vector(0)", @@ -705,7 +705,7 @@ "title": "Last Build", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 8, "y": 37}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "time() - max(homelab_deploy_build_last_timestamp)", @@ -739,7 +739,7 @@ "title": "Avg Build Time", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 12, "y": 37}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(increase(homelab_deploy_build_duration_seconds_sum[24h])) / sum(increase(homelab_deploy_build_duration_seconds_count[24h]))", @@ -773,7 +773,7 @@ "title": "Total Hosts Built", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 16, "y": 37}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(homelab_deploy_build_duration_seconds_count)", @@ -802,7 +802,7 @@ "title": "Build Jobs (24h)", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 20, "y": 37}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(increase(homelab_deploy_builds_total[24h]))", @@ -832,7 +832,7 @@ "title": "Build Time by Host", "type": "bargauge", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 41}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sort_desc(homelab_deploy_build_duration_seconds_sum / homelab_deploy_build_duration_seconds_count)", @@ -869,7 +869,7 @@ "title": "Build Count by Host", "type": "bargauge", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 41}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sort_desc(sum by (host) (homelab_deploy_build_host_total))", @@ -903,7 +903,7 @@ "title": "Build Activity", "type": "timeseries", "gridPos": {"h": 8, "w": 24, "x": 0, "y": 49}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(increase(homelab_deploy_build_host_total{status=\"success\"}[1h]))", diff --git a/services/grafana/dashboards/node-exporter.json b/services/grafana/dashboards/node-exporter.json index 5da2746..119a884 100644 --- a/services/grafana/dashboards/node-exporter.json +++ b/services/grafana/dashboards/node-exporter.json @@ -11,7 +11,7 @@ { "name": "instance", "type": "query", - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "query": "label_values(node_uname_info, instance)", "refresh": 2, "includeAll": false, @@ -26,7 +26,7 @@ "title": "CPU Usage", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "100 - (avg by(instance) (rate(node_cpu_seconds_total{mode=\"idle\", instance=~\"$instance\"}[5m])) * 100)", @@ -55,7 +55,7 @@ "title": "Memory Usage", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "(1 - (node_memory_MemAvailable_bytes{instance=~\"$instance\"} / node_memory_MemTotal_bytes{instance=~\"$instance\"})) * 100", @@ -84,7 +84,7 @@ "title": "Disk Usage", "type": "gauge", "gridPos": {"h": 8, "w": 8, "x": 0, "y": 8}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "100 - ((node_filesystem_avail_bytes{instance=~\"$instance\",mountpoint=\"/\",fstype!=\"rootfs\"} / node_filesystem_size_bytes{instance=~\"$instance\",mountpoint=\"/\",fstype!=\"rootfs\"}) * 100)", @@ -113,7 +113,7 @@ "title": "System Load", "type": "timeseries", "gridPos": {"h": 8, "w": 8, "x": 8, "y": 8}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "node_load1{instance=~\"$instance\"}", @@ -142,7 +142,7 @@ "title": "Uptime", "type": "stat", "gridPos": {"h": 8, "w": 8, "x": 16, "y": 8}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "time() - node_boot_time_seconds{instance=~\"$instance\"}", @@ -161,7 +161,7 @@ "title": "Network Traffic", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 16}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "rate(node_network_receive_bytes_total{instance=~\"$instance\",device!~\"lo|veth.*|br.*|docker.*\"}[5m])", @@ -185,7 +185,7 @@ "title": "Disk I/O", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 16}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "rate(node_disk_read_bytes_total{instance=~\"$instance\",device!~\"dm-.*\"}[5m])", diff --git a/services/grafana/dashboards/proxmox.json b/services/grafana/dashboards/proxmox.json index 0f61f2b..5bf5941 100644 --- a/services/grafana/dashboards/proxmox.json +++ b/services/grafana/dashboards/proxmox.json @@ -15,7 +15,7 @@ { "name": "vm", "type": "query", - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "query": "label_values(pve_guest_info{template=\"0\"}, name)", "refresh": 2, "includeAll": true, @@ -30,7 +30,7 @@ "title": "VMs Running", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 0, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(pve_up{id=~\"qemu/.*\"} * on(id) pve_guest_info{template=\"0\"} == 1)", @@ -56,7 +56,7 @@ "title": "VMs Stopped", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 4, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(pve_up{id=~\"qemu/.*\"} * on(id) pve_guest_info{template=\"0\"} == 0)", @@ -87,7 +87,7 @@ "title": "Node CPU", "type": "gauge", "gridPos": {"h": 4, "w": 4, "x": 8, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_cpu_usage_ratio{id=~\"node/.*\"} * 100", @@ -120,7 +120,7 @@ "title": "Node Memory", "type": "gauge", "gridPos": {"h": 4, "w": 4, "x": 12, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_memory_usage_bytes{id=~\"node/.*\"} / pve_memory_size_bytes{id=~\"node/.*\"} * 100", @@ -153,7 +153,7 @@ "title": "Node Uptime", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 16, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_uptime_seconds{id=~\"node/.*\"}", @@ -180,7 +180,7 @@ "title": "Templates", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 20, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(pve_guest_info{template=\"1\"})", @@ -206,7 +206,7 @@ "title": "VM Status", "type": "table", "gridPos": {"h": 10, "w": 24, "x": 0, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_guest_info{template=\"0\", name=~\"$vm\"}", @@ -362,7 +362,7 @@ "title": "VM CPU Usage", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 14}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_cpu_usage_ratio{id=~\"qemu/.*\"} * on(id) group_left(name) pve_guest_info{template=\"0\", name=~\"$vm\"} * 100", @@ -391,7 +391,7 @@ "title": "VM Memory Usage", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 14}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_memory_usage_bytes{id=~\"qemu/.*\"} * on(id) group_left(name) pve_guest_info{template=\"0\", name=~\"$vm\"}", @@ -420,7 +420,7 @@ "title": "VM Network Traffic", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 22}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "rate(pve_network_receive_bytes{id=~\"qemu/.*\"}[5m]) * on(id) group_left(name) pve_guest_info{template=\"0\", name=~\"$vm\"}", @@ -453,7 +453,7 @@ "title": "VM Disk I/O", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 22}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "rate(pve_disk_read_bytes{id=~\"qemu/.*\"}[5m]) * on(id) group_left(name) pve_guest_info{template=\"0\", name=~\"$vm\"}", @@ -486,7 +486,7 @@ "title": "Storage Usage", "type": "bargauge", "gridPos": {"h": 6, "w": 12, "x": 0, "y": 30}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_disk_usage_bytes{id=~\"storage/.*\"} / pve_disk_size_bytes{id=~\"storage/.*\"} * 100", @@ -531,7 +531,7 @@ "title": "Storage Capacity", "type": "table", "gridPos": {"h": 6, "w": 12, "x": 12, "y": 30}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "pve_disk_size_bytes{id=~\"storage/.*\"}", diff --git a/services/grafana/dashboards/systemd.json b/services/grafana/dashboards/systemd.json index 8162527..be38f48 100644 --- a/services/grafana/dashboards/systemd.json +++ b/services/grafana/dashboards/systemd.json @@ -15,7 +15,7 @@ { "name": "hostname", "type": "query", - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "query": "label_values(systemd_unit_state, hostname)", "refresh": 2, "includeAll": true, @@ -30,7 +30,7 @@ "title": "Failed Units", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 0, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(systemd_unit_state{state=\"failed\", hostname=~\"$hostname\"} == 1) or vector(0)", @@ -60,7 +60,7 @@ "title": "Active Units", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 4, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(systemd_unit_state{state=\"active\", hostname=~\"$hostname\"} == 1)", @@ -86,7 +86,7 @@ "title": "Hosts Monitored", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 8, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(count by (hostname) (systemd_unit_state{hostname=~\"$hostname\"}))", @@ -112,7 +112,7 @@ "title": "Total Service Restarts", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 12, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum(systemd_service_restart_total{hostname=~\"$hostname\"})", @@ -143,7 +143,7 @@ "title": "Inactive Units", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 16, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(systemd_unit_state{state=\"inactive\", hostname=~\"$hostname\"} == 1)", @@ -169,7 +169,7 @@ "title": "Timers", "type": "stat", "gridPos": {"h": 4, "w": 4, "x": 20, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "count(systemd_timer_last_trigger_seconds{hostname=~\"$hostname\"})", @@ -195,7 +195,7 @@ "title": "Failed Units", "type": "table", "gridPos": {"h": 6, "w": 12, "x": 0, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "systemd_unit_state{state=\"failed\", hostname=~\"$hostname\"} == 1", @@ -251,7 +251,7 @@ "title": "Service Restarts (Top 15)", "type": "table", "gridPos": {"h": 6, "w": 12, "x": 12, "y": 4}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "topk(15, systemd_service_restart_total{hostname=~\"$hostname\"} > 0)", @@ -309,7 +309,7 @@ "title": "Active Units per Host", "type": "bargauge", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 10}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sort_desc(count by (hostname) (systemd_unit_state{state=\"active\", hostname=~\"$hostname\"} == 1))", @@ -339,7 +339,7 @@ "title": "NixOS Upgrade Timers", "type": "table", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 10}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "systemd_timer_last_trigger_seconds{name=\"nixos-upgrade.timer\", hostname=~\"$hostname\"}", @@ -429,7 +429,7 @@ "title": "Backup Timers", "type": "table", "gridPos": {"h": 6, "w": 12, "x": 0, "y": 18}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "systemd_timer_last_trigger_seconds{name=~\"restic.*\", hostname=~\"$hostname\"}", @@ -524,7 +524,7 @@ "title": "Service Restarts Over Time", "type": "timeseries", "gridPos": {"h": 6, "w": 12, "x": 12, "y": 18}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "sum by (hostname) (increase(systemd_service_restart_total{hostname=~\"$hostname\"}[1h]))", diff --git a/services/grafana/dashboards/temperature.json b/services/grafana/dashboards/temperature.json index 7c80e6a..95baff3 100644 --- a/services/grafana/dashboards/temperature.json +++ b/services/grafana/dashboards/temperature.json @@ -19,7 +19,7 @@ "title": "Current Temperatures", "type": "stat", "gridPos": {"h": 6, "w": 12, "x": 0, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "hass_sensor_temperature_celsius{entity!~\".*device_temperature\"}", @@ -71,7 +71,7 @@ "title": "Average Home Temperature", "type": "gauge", "gridPos": {"h": 6, "w": 6, "x": 12, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "avg(hass_sensor_temperature_celsius{entity!~\".*device_temperature|.*server.*\"})", @@ -108,7 +108,7 @@ "title": "Current Humidity", "type": "stat", "gridPos": {"h": 6, "w": 6, "x": 18, "y": 0}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "hass_sensor_humidity_percent{entity!~\".*server.*\"}", @@ -154,7 +154,7 @@ "title": "Temperature History (30 Days)", "type": "timeseries", "gridPos": {"h": 10, "w": 24, "x": 0, "y": 6}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "hass_sensor_temperature_celsius{entity!~\".*device_temperature\"}", @@ -207,7 +207,7 @@ "title": "Temperature Trend (1h rate of change)", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 16}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "deriv(hass_sensor_temperature_celsius{entity!~\".*device_temperature\"}[1h]) * 3600", @@ -268,7 +268,7 @@ "title": "24h Min / Max / Avg", "type": "table", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 16}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "min_over_time(hass_sensor_temperature_celsius{entity!~\".*device_temperature\"}[24h])", @@ -346,7 +346,7 @@ "title": "Humidity History (30 Days)", "type": "timeseries", "gridPos": {"h": 8, "w": 24, "x": 0, "y": 24}, - "datasource": {"type": "prometheus", "uid": "prometheus"}, + "datasource": {"type": "prometheus", "uid": "victoriametrics"}, "targets": [ { "expr": "hass_sensor_humidity_percent", diff --git a/services/grafana/default.nix b/services/grafana/default.nix index 3da828b..d9a2e7b 100644 --- a/services/grafana/default.nix +++ b/services/grafana/default.nix @@ -37,6 +37,10 @@ # Declarative datasources provision.datasources.settings = { apiVersion = 1; + prune = true; + deleteDatasources = [ + { name = "Prometheus (monitoring01)"; orgId = 1; } + ]; datasources = [ { name = "VictoriaMetrics";