From e2aa30cb2c48b34337aad133bacb0a8cb57cfe8c Mon Sep 17 00:00:00 2001 From: aexel90 Date: Tue, 18 Oct 2022 23:51:18 +0200 Subject: [PATCH] update --- Dockerfile.multistage | 3 +- docker-compose.yml | 1 + grafana/dashboard.json | 163 ++++++++++++++++++++++++----------------- 3 files changed, 100 insertions(+), 67 deletions(-) diff --git a/Dockerfile.multistage b/Dockerfile.multistage index 73d814d..ef60c6b 100644 --- a/Dockerfile.multistage +++ b/Dockerfile.multistage @@ -9,6 +9,7 @@ RUN go build -o /hue_exporter FROM alpine:latest WORKDIR / COPY --from=build /hue_exporter /hue_exporter +COPY hue_metrics.json ./ EXPOSE 9773 -ENTRYPOINT [ "sh", "-c", "/hue_exporter -username ${USERNAME} -hue-url ${HUE_URL} -metrics-file ${METRICS_FILE} " ] \ No newline at end of file +ENTRYPOINT [ "sh", "-c", "/hue_exporter -username ${USERNAME} -hue-url ${HUE_URL} -metrics-file hue_metrics.json" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index aba6040..b7e3ce0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ services: dockerfile: ./Dockerfile.multistage restart: unless-stopped container_name: hue_exporter + network_mode: "host" ports: - 9773:9773 env_file: diff --git a/grafana/dashboard.json b/grafana/dashboard.json index 41192ba..70599b4 100644 --- a/grafana/dashboard.json +++ b/grafana/dashboard.json @@ -25,15 +25,12 @@ "fiscalYearStartMonth": 0, "gnetId": 13645, "graphTooltip": 0, - "id": 4, + "id": 2, "links": [], "liveNow": false, "panels": [ { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "fieldConfig": { "defaults": { "mappings": [], @@ -75,9 +72,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_bridge_info", "format": "table", "instant": true, @@ -92,7 +94,7 @@ { "datasource": { "type": "prometheus", - "uid": "nLstfzWgz" + "uid": "woSee8Zgk" }, "fieldConfig": { "defaults": { @@ -135,9 +137,13 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, "expr": "hue_bridge_info", "format": "table", "instant": true, @@ -150,10 +156,7 @@ "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "fieldConfig": { "defaults": { "mappings": [], @@ -195,9 +198,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_bridge_info", "format": "table", "instant": true, @@ -210,10 +218,7 @@ "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "fieldConfig": { "defaults": { "mappings": [], @@ -255,9 +260,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_bridge_info", "format": "table", "instant": true, @@ -270,10 +280,7 @@ "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "fieldConfig": { "defaults": { "mappings": [], @@ -316,9 +323,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_bridge_info", "format": "table", "instant": true, @@ -331,10 +343,7 @@ "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "fieldConfig": { "defaults": { "mappings": [], @@ -376,9 +385,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_bridge_info", "format": "table", "instant": true, @@ -391,10 +405,7 @@ "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "fieldConfig": { "defaults": { "mappings": [], @@ -437,9 +448,14 @@ "text": {}, "textMode": "value" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_bridge_info", "format": "table", "instant": true, @@ -452,10 +468,7 @@ "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "description": "", "fieldConfig": { "defaults": { @@ -497,9 +510,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "sum(hue_light_state)", "format": "table", "hide": false, @@ -514,10 +532,7 @@ "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "description": "", "fieldConfig": { "defaults": { @@ -559,9 +574,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "count(hue_light_state)-sum(hue_light_state)", "format": "table", "instant": true, @@ -584,10 +604,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "decimals": 1, "fill": 0, "fillGradient": 4, @@ -619,7 +636,7 @@ "alertThreshold": false }, "percentage": false, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "pointradius": 2, "points": false, "renderer": "flot", @@ -629,9 +646,15 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "10^((hue_sensor_lightlevel-1)/10000)", "interval": "", "legendFormat": "{{name}}", + "range": true, "refId": "A" } ], @@ -679,10 +702,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "decimals": 1, "fill": 0, "fillGradient": 4, @@ -714,7 +734,7 @@ "alertThreshold": false }, "percentage": false, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "pointradius": 2, "points": false, "renderer": "flot", @@ -724,9 +744,15 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_sensor_temperature/100", "interval": "", "legendFormat": "{{name}}", + "range": true, "refId": "A" } ], @@ -765,10 +791,7 @@ } }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, "fieldConfig": { "defaults": { "color": { @@ -923,9 +946,14 @@ } ] }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_sensor_info{type=~\"ZLL.*\"}", "format": "table", "instant": true, @@ -976,10 +1004,8 @@ "type": "table" }, { - "datasource": { - "type": "prometheus", - "uid": "nLstfzWgz" - }, + "datasource": {}, + "description": "", "fieldConfig": { "defaults": { "color": { @@ -1172,9 +1198,14 @@ } ] }, - "pluginVersion": "8.5.3", + "pluginVersion": "9.2.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "woSee8Zgk" + }, + "editorMode": "code", "expr": "hue_light_info", "format": "table", "instant": true, @@ -1229,20 +1260,20 @@ } ], "refresh": "5m", - "schemaVersion": 36, + "schemaVersion": 37, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { - "from": "now-6h", + "from": "now-30m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Philips Hue", "uid": "X7uYULiRk", - "version": 6, + "version": 5, "weekStart": "" } \ No newline at end of file