feat: rework hass monitoring

This commit is contained in:
auricom
2022-02-06 22:49:27 +01:00
parent 14e31f2385
commit 81242ca162
6 changed files with 122 additions and 599 deletions

View File

@@ -9,12 +9,13 @@
"pluginName": "Prometheus"
}
],
"__elements": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "8.0.5"
"version": "8.3.4"
},
{
"type": "datasource",
@@ -38,18 +39,24 @@
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"editable": false,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
@@ -68,6 +75,9 @@
"viz": false
},
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
@@ -111,7 +121,11 @@
"id": 6,
"options": {
"legend": {
"calcs": ["mean", "max", "min"],
"calcs": [
"mean",
"max",
"min"
],
"displayMode": "table",
"placement": "right"
},
@@ -122,36 +136,46 @@
"pluginVersion": "8.0.5",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "hass_sensor_temperature_celsius{entity=~\"sensor.temperature_living_room_temperature\"}",
"expr": "sum(hass_sensor_temperature_celsius{entity=\"sensor.temperature_living_room_temperature\"})",
"instant": false,
"interval": "",
"legendFormat": "Salon",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "hass_sensor_temperature_celsius{entity=~\"sensor.temperature_bedroom_temperature\"}",
"expr": "sum(hass_sensor_temperature_celsius{entity=~\"sensor.temperature_bedroom_temperature\"})",
"hide": false,
"interval": "",
"legendFormat": "Chambre 1",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "hass_sensor_temperature_celsius{entity=~\"sensor.temperature_office_temperature\"}",
"expr": "sum(hass_sensor_temperature_celsius{entity=~\"sensor.temperature_office_temperature\"})",
"hide": false,
"interval": "",
"legendFormat": "Bureau",
"refId": "C"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Home",
"type": "timeseries"
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "",
"fieldConfig": {
"defaults": {
@@ -214,7 +238,10 @@
"id": 7,
"options": {
"legend": {
"calcs": ["mean", "max"],
"calcs": [
"mean",
"max"
],
"displayMode": "table",
"placement": "right"
},
@@ -225,28 +252,37 @@
"pluginVersion": "8.0.5",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "hass_sensor_power_w{entity=\"sensor.servers_plug_switch_electricity_power\"}",
"expr": "sum(hass_sensor_power_w{entity=\"sensor.servers_plug_switch_electricity_power\"})",
"interval": "",
"legendFormat": "Servers",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "hass_sensor_power_w{entity=\"sensor.bureau_plug_switch_electricity_power\"}",
"expr": "sum(hass_sensor_power_w{entity=\"sensor.bureau_plug_switch_electricity_power\"})",
"hide": false,
"interval": "",
"legendFormat": "claude-fixe",
"refId": "B"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Computers",
"type": "timeseries"
},
{
"datasource": "${DS_PROMETHEUS}",
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
@@ -308,7 +344,10 @@
"id": 8,
"options": {
"legend": {
"calcs": ["mean", "max"],
"calcs": [
"mean",
"max"
],
"displayMode": "table",
"placement": "right"
},
@@ -342,15 +381,15 @@
"refId": "C"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Home Cinema",
"type": "timeseries"
}
],
"schemaVersion": 30,
"schemaVersion": 34,
"style": "dark",
"tags": ["home-assistant"],
"tags": [
"home-assistant"
],
"templating": {
"list": []
},
@@ -374,5 +413,6 @@
"timezone": "",
"title": "Home-Assistant",
"uid": "sn-bOoWMk",
"version": 1
}
"version": 1,
"weekStart": ""
}

View File

@@ -9,12 +9,13 @@
"pluginName": "Prometheus"
}
],
"__elements": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "8.0.5"
"version": "8.3.4"
},
{
"type": "datasource",
@@ -38,18 +39,28 @@
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"editable": false,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": "${DS_PROMETHEUS}",
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
@@ -111,7 +122,11 @@
"id": 5,
"options": {
"legend": {
"calcs": ["mean", "max", "min"],
"calcs": [
"mean",
"max",
"min"
],
"displayMode": "table",
"placement": "right"
},
@@ -129,13 +144,14 @@
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "OPNsense - CPU",
"type": "timeseries"
},
{
"datasource": "${DS_PROMETHEUS}",
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "",
"fieldConfig": {
"defaults": {
@@ -203,7 +219,11 @@
"id": 2,
"options": {
"legend": {
"calcs": ["mean", "max", "min"],
"calcs": [
"mean",
"max",
"min"
],
"displayMode": "table",
"placement": "right"
},
@@ -222,14 +242,11 @@
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "k3s Nodes - CPU",
"transformations": [],
"type": "timeseries"
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
@@ -291,7 +308,11 @@
"id": 6,
"options": {
"legend": {
"calcs": ["mean", "max", "min"],
"calcs": [
"mean",
"max",
"min"
],
"displayMode": "hidden",
"placement": "right"
},
@@ -302,22 +323,26 @@
"pluginVersion": "8.0.5",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "hass_sensor_temperature_celsius{entity=~\"sensor.temperature_servers_temperature\"}",
"expr": "sum(hass_sensor_temperature_celsius{entity=~\"sensor.temperature_servers_temperature\"})",
"interval": "",
"legendFormat": "datacenter",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Datacenter",
"type": "timeseries"
}
],
"schemaVersion": 30,
"schemaVersion": 34,
"style": "dark",
"tags": ["homelab"],
"tags": [
"homelab"
],
"templating": {
"list": []
},
@@ -341,5 +366,6 @@
"timezone": "",
"title": "Homelab / Temperatures",
"uid": "aEY0BVGnz",
"version": 1
}
"version": 1,
"weekStart": ""
}

View File

@@ -1,539 +0,0 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "8.1.0"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"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": false,
"gnetId": null,
"graphTooltip": 0,
"id": null,
"iteration": 1630311640136,
"links": [],
"panels": [
{
"collapsed": false,
"datasource": "${DS_PROMETHEUS}",
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 6,
"panels": [],
"repeat": "pair",
"title": "${pair}",
"type": "row"
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red",
"value": null
},
{
"color": "dark-green",
"value": 20
}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 3,
"x": 0,
"y": 1
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.1.0",
"targets": [
{
"exemplar": true,
"expr": "terra_pool_pairs_apr{slug=\"${pair}\"}",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "APR",
"type": "stat"
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "dark-green",
"value": null
}
]
},
"unit": "currencyUSD"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 2,
"x": 3,
"y": 1
},
"id": 9,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.1.0",
"targets": [
{
"exemplar": true,
"expr": "terra_pool_pairs_liquidity{slug=\"${pair}\"}",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Liquidity",
"type": "stat"
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMax": 200,
"axisSoftMin": 0,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 20,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 20
}
]
},
"unit": "percent"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "APR"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-yellow",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 19,
"x": 5,
"y": 1
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "hidden",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"exemplar": true,
"expr": "sum(terra_pool_pairs_apr{slug=\"${pair}\"})",
"instant": false,
"interval": "",
"legendFormat": "APR",
"refId": "A"
}
],
"title": "APR",
"type": "timeseries"
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 3,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "dark-green",
"value": null
}
]
},
"unit": "currencyUSD"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 2,
"x": 3,
"y": 4
},
"id": 10,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.1.0",
"targets": [
{
"exemplar": true,
"expr": "terra_pool_pairs_vol_24h{slug=\"${pair}\"}",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"title": "Volume (24h)",
"type": "stat"
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 20,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "dark-green",
"value": null
}
]
},
"unit": "currencyUSD"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Liquidity"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-blue",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Volume (24h)"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-orange",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 19,
"x": 5,
"y": 10
},
"id": 11,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"exemplar": true,
"expr": "sum(terra_pool_pairs_liquidity{slug=\"${pair}\"})",
"instant": false,
"interval": "",
"legendFormat": "Liquidity",
"refId": "A"
},
{
"exemplar": false,
"expr": "sum(terra_pool_pairs_vol_24h{slug=\"${pair}\"})",
"hide": false,
"instant": false,
"interval": "",
"legendFormat": "Volume (24h)",
"refId": "B"
}
],
"title": "Stats",
"type": "timeseries"
}
],
"schemaVersion": 30,
"style": "dark",
"tags": [
"crypto",
"terra"
],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": true,
"text": [
"bluna-luna",
"meth-beth"
],
"value": [
"bluna-luna",
"meth-beth"
]
},
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": true,
"name": "pair",
"options": [
{
"selected": true,
"text": "bluna-luna",
"value": "bluna-luna"
},
{
"selected": true,
"text": "meth-beth",
"value": "meth-beth"
}
],
"query": "bluna-luna,meth-beth",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
}
]
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Terra",
"uid": "2A-Ckrn7z",
"version": 1
}

View File

@@ -136,9 +136,6 @@ spec:
sonarr:
url: https://raw.githubusercontent.com/k8s-at-home/grafana-dashboards/main/sonarr.json
datasource: Prometheus
terra:
url: https://raw.githubusercontent.com/auricom/home-cluster/main/cluster/apps/monitoring/kube-prometheus-stack/grafana-dashboards/terra.json
datasource: Prometheus
deploymentStrategy:
type: Recreate
persistence:
@@ -280,13 +277,13 @@ spec:
- targets: ["${LOCAL_LAN_TRUENAS}:9273"]
labels:
app: "truenas"
# - job_name: "truenas-remote"
# scrape_interval: 60s
# metrics_path: "/metrics"
# static_configs:
# - targets: ["${LOCAL_LAN_TRUENAS_REMOTE}:9273"]
# labels:
# app: "truenas-remote"
- job_name: "truenas-remote"
scrape_interval: 60s
metrics_path: "/metrics"
static_configs:
- targets: ["${LOCAL_LAN_TRUENAS_REMOTE}:9273"]
labels:
app: "truenas-remote"
# Example scrape config for probing ingresses via the Blackbox Exporter.
#
# The relabeling allows the actual ingress scrape endpoint to be configured