alexjustesen / speedtest-tracker-docs

Docs for Speedtest Tracker.
https://docs.speedtest-tracker.dev/
15 stars 20 forks source link

Grafana Dashboard Guage Question #9

Closed samcro1967 closed 1 year ago

samcro1967 commented 1 year ago

Thank you keeping this project going. Appreciate your work.

I have the grafana dashboard setup. I see data in the graphs, but not in the gauges. Not sure what I am missing. I am not a Grafana expert. If I click on edit for a gauge, click on query inspector, and then the data tab, it shows the correct value there. Not sure why it is then not showing on the gauge.

image

oregonpillow commented 1 month ago

@samcro1967 did you fix this issue in the end? Would you mind sharing your grafana dashboard json? Looks really nice 👌

samcro1967 commented 4 weeks ago

No. I am no longer able to import the dashboard to test it again. Grafana says "Dashboard Not Found" even when trying to import with the downloaded json. I just look at the graph in the speedtest-tracker so I can only see up to the last 30 days.

The link to the dashboard is at the bottom of this issue for future reference: https://github.com/alexjustesen/speedtest-tracker-docs/issues/4

samcro1967 commented 4 weeks ago

@oregonpillow I have been able to get this to work. See if the JSON below works for you as well. You must be running InfluxDB 2.x and assumes the bucket is called speedtest. I am running Grafana 11.0.0 Not sure if this will work with older versions or not.

Dashboard JSON Model ``` { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "datasource", "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" } ] }, "description": "Dashboard for Speedtest Tracker v2 - Updated by Samcor1967 on 6/22/24", "editable": true, "fiscalYearStartMonth": 0, "gnetId": 17460, "graphTooltip": 0, "id": 51, "links": [ { "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": false, "tags": [], "targetBlank": true, "title": "Speedtest-Tracker@GitHub", "tooltip": "GitHub Repository", "type": "link", "url": "https://github.com/alexjustesen/speedtest-tracker" } ], "liveNow": false, "panels": [ { "collapsed": false, "datasource": { "type": "influxdb", "uid": "aIJpPB_nk" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 115, "panels": [], "title": "Speedtest Tracker v2", "type": "row" }, { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "center", "cellOptions": { "type": "auto" }, "inspect": false, "minWidth": 150 }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [ { "matcher": { "id": "byName", "options": "Server ID" }, "properties": [ { "id": "custom.cellOptions", "value": { "type": "auto" } }, { "id": "mappings", "value": [] }, { "id": "unit", "value": "string" } ] }, { "matcher": { "id": "byName", "options": "DL Speed (mean)" }, "properties": [ { "id": "unit", "value": "bps" } ] }, { "matcher": { "id": "byName", "options": "UL Speed (mean)" }, "properties": [ { "id": "unit", "value": "bps" } ] }, { "matcher": { "id": "byName", "options": "Ping (mean)" }, "properties": [ { "id": "unit", "value": "ms" } ] }, { "matcher": { "id": "byName", "options": "Ping jitter (mean)" }, "properties": [ { "id": "unit", "value": "ms" } ] }, { "matcher": { "id": "byName", "options": "Packet Loss (mean)" }, "properties": [ { "id": "unit", "value": "percent" } ] } ] }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 1 }, "id": 121, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 7, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "ID" } ] }, "pluginVersion": "11.0.0", "targets": [ { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "hide": false, "query": "from(bucket: \"speedtest\")\r\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"speedtest\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"server_id\" or r[\"_field\"] == \"server_name\" or r[\"_field\"] == \"download_bits\" or r[\"_field\"] == \"download_jitter\" or r[\"_field\"] == \"upload_bits\" or r[\"_field\"] == \"upload_jitter\" or r[\"_field\"] == \"ping\" or r[\"_field\"] == \"ping_jitter\" or r[\"_field\"] == \"packet_loss\")\r\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\r\n |> yield(name: \"last\")", "refId": "A" } ], "title": "Average by Server", "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "scheduled": true, "server_id": false }, "indexByName": { "Time": 0, "download_bits": 3, "download_jitter": 4, "packet_loss": 9, "ping": 7, "ping_jitter": 8, "server_id": 1, "server_name": 2, "upload_bits": 5, "upload_jitter": 6 }, "renameByName": { "Time": "Time", "download": "Download (Mbit/s)", "download_bits": "DL Speed", "download_jitter": "DL jitter", "id": "ID", "id {host=\"speedtest\", name=\"speedtest\"}": "", "packet_loss": "Packet Loss", "ping": "Ping", "ping_jitter": "Ping jitter", "scheduled": "", "server_host": "Server Host", "server_id": "Server ID", "server_name": "Server Name", "upload": "Upload (Mbit/s)", "upload_bits": "UL Speed", "upload_jitter": "UL jitter" } } }, { "id": "groupBy", "options": { "fields": { "DL (Mbit/s)": { "aggregations": [ "mean" ], "operation": "aggregate" }, "DL Speed": { "aggregations": [ "mean" ], "operation": "aggregate" }, "Packet Loss": { "aggregations": [ "mean" ], "operation": "aggregate" }, "Ping": { "aggregations": [ "mean" ], "operation": "aggregate" }, "Ping (ms)": { "aggregations": [ "mean" ], "operation": "aggregate" }, "Ping jitter": { "aggregations": [ "mean" ], "operation": "aggregate" }, "Server ID": { "aggregations": [], "operation": "groupby" }, "Server Name": { "aggregations": [], "operation": "groupby" }, "UL (Mbit/s)": { "aggregations": [ "mean" ], "operation": "aggregate" }, "UL Speed": { "aggregations": [ "mean" ], "operation": "aggregate" } } } } ], "type": "table" }, { "datasource": { "type": "influxdb", "uid": "000000002" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "bps" }, "overrides": [] }, "gridPos": { "h": 6, "w": 6, "x": 0, "y": 5 }, "hideTimeOverride": false, "id": 116, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "last" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto", "text": {} }, "pluginVersion": "11.0.0", "targets": [ { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "groupBy": [], "hide": false, "measurement": "speedtest", "orderByTime": "ASC", "policy": "default", "query": "from(bucket: \"speedtest\")\r\n |> range(start: -1h) // Adjust this to the time range you need\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"speedtest\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"download_bits\")\r\n |> last()\r\n", "refId": "A", "resultFormat": "time_series" } ], "title": "Last Test: DL Speed", "type": "gauge" }, { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisGridShow": true, "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 45, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "smooth", "lineStyle": { "fill": "solid" }, "lineWidth": 2, "pointSize": 4, "scaleDistribution": { "type": "linear" }, "showPoints": "always", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "Mbits" }, "overrides": [ { "matcher": { "id": "byName", "options": "download_bits" }, "properties": [ { "id": "unit", "value": "bps" }, { "id": "displayName", "value": "Download Speed" } ] }, { "matcher": { "id": "byName", "options": "upload_bits" }, "properties": [ { "id": "unit", "value": "bps" }, { "id": "displayName", "value": "Upload Speed" } ] } ] }, "gridPos": { "h": 12, "w": 18, "x": 6, "y": 5 }, "id": 104, "interval": "", "options": { "legend": { "calcs": [ "lastNotNull", "mean", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "maxHeight": 600, "mode": "multi", "sort": "none" } }, "pluginVersion": "8.5.2", "targets": [ { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "hide": false, "query": "from(bucket: \"speedtest\")\r\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"speedtest\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"download_bits\" or r[\"_field\"] == \"upload_bits\")\r\n |> drop(columns: [\"server_host\",\"server_name\"])\r\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\r\n |> yield(name: \"last\")", "refId": "C" } ], "title": "DL/UL Speed", "type": "timeseries" }, { "datasource": { "type": "influxdb", "uid": "000000002" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "light-yellow", "value": 7 }, { "color": "green", "value": 9 } ] }, "unit": "bps" }, "overrides": [] }, "gridPos": { "h": 6, "w": 6, "x": 0, "y": 11 }, "id": 117, "interval": "", "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "last" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "11.0.0", "targets": [ { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "linear" ], "type": "fill" } ], "measurement": "speedtest", "orderByTime": "ASC", "policy": "default", "query": "from(bucket: \"speedtest\")\r\n |> range(start: -1h) // Adjust this to the time range you need\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"speedtest\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"upload_bits\")\r\n |> last()\r\n", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "upload" ], "type": "field" }, { "params": [], "type": "last" } ] ], "tags": [] } ], "title": "Last Test: UL Speed", "type": "gauge" }, { "datasource": { "type": "influxdb", "uid": "000000002" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 50 } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 7, "w": 6, "x": 0, "y": 17 }, "id": 118, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "last" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "11.0.0", "targets": [ { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "groupBy": [ { "params": [ "$__interval" ], "type": "time" }, { "params": [ "linear" ], "type": "fill" } ], "measurement": "speedtest", "orderByTime": "ASC", "policy": "default", "query": "from(bucket: \"speedtest\")\r\n |> range(start: -1h) // Adjust this to the time range you need\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"speedtest\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"ping\")\r\n |> last()\r\n", "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ "ping" ], "type": "field" }, { "params": [], "type": "last" } ] ], "tags": [] } ], "title": "Last Test: Ping", "type": "gauge" }, { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 30, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 3, "scaleDistribution": { "type": "linear" }, "showPoints": "always", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "#EAB839", "value": 20 }, { "color": "red", "value": 30 } ] }, "unit": "ms" }, "overrides": [ { "matcher": { "id": "byName", "options": "ping" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "displayName", "value": "Ping" } ] }, { "matcher": { "id": "byName", "options": "ping_jitter" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } }, { "id": "displayName", "value": "Jitter" } ] } ] }, "gridPos": { "h": 7, "w": 18, "x": 6, "y": 17 }, "id": 119, "interval": "", "options": { "legend": { "calcs": [ "mean", "max", "min" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "maxHeight": 600, "mode": "multi", "sort": "none" } }, "pluginVersion": "8.5.2", "targets": [ { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "hide": false, "query": "from(bucket: \"speedtest\")\r\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"speedtest\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"ping\" or r[\"_field\"] == \"ping_jitter\")\r\n |> drop(columns: [\"server_host\",\"server_name\"])\r\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\r\n |> yield(name: \"last\")", "refId": "C" } ], "title": "Ping", "type": "timeseries" }, { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "center", "cellOptions": { "type": "auto" }, "inspect": false, "minWidth": 150 }, "decimals": 1, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [ { "matcher": { "id": "byName", "options": "Server ID" }, "properties": [ { "id": "custom.cellOptions", "value": { "type": "auto" } }, { "id": "mappings", "value": [] }, { "id": "unit", "value": "string" } ] }, { "matcher": { "id": "byName", "options": "DL Speed" }, "properties": [ { "id": "unit", "value": "bps" } ] }, { "matcher": { "id": "byName", "options": "UL Speed" }, "properties": [ { "id": "unit", "value": "bps" } ] }, { "matcher": { "id": "byName", "options": "Ping" }, "properties": [ { "id": "unit", "value": "ms" } ] }, { "matcher": { "id": "byName", "options": "Ping jitter" }, "properties": [ { "id": "unit", "value": "ms" } ] }, { "matcher": { "id": "byName", "options": "Packet Loss" }, "properties": [ { "id": "unit", "value": "percent" } ] } ] }, "gridPos": { "h": 6, "w": 24, "x": 0, "y": 24 }, "id": 122, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 7, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "Time" } ] }, "pluginVersion": "11.0.0", "targets": [ { "datasource": { "type": "influxdb", "uid": "Speedtests" }, "hide": false, "query": "from(bucket: \"speedtest\")\r\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"speedtest\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"server_id\" or r[\"_field\"] == \"server_name\" or r[\"_field\"] == \"download_bits\" or r[\"_field\"] == \"download_jitter\" or r[\"_field\"] == \"upload_bits\" or r[\"_field\"] == \"upload_jitter\" or r[\"_field\"] == \"ping\" or r[\"_field\"] == \"ping_jitter\" or r[\"_field\"] == \"packet_loss\")\r\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\r\n |> yield(name: \"last\")", "refId": "A" } ], "title": "All Tests", "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "download_jitter": true, "scheduled": true, "server_id": false, "upload_jitter": true }, "indexByName": { "Time": 0, "download_bits": 3, "download_jitter": 4, "packet_loss": 9, "ping": 7, "ping_jitter": 8, "server_id": 1, "server_name": 2, "upload_bits": 5, "upload_jitter": 6 }, "renameByName": { "Time": "Time", "download": "Download (Mbit/s)", "download_bits": "DL Speed", "download_jitter": "DL jitter", "id": "ID", "id {host=\"speedtest\", name=\"speedtest\"}": "", "packet_loss": "Packet Loss", "ping": "Ping", "ping_jitter": "Ping jitter", "scheduled": "", "server_host": "Server Host", "server_id": "Server ID", "server_name": "Server Name", "upload": "Upload (Mbit/s)", "upload_bits": "UL Speed", "upload_jitter": "UL jitter" } } }, { "id": "groupBy", "options": { "fields": { "DL (Mbit/s)": { "aggregations": [ "mean" ], "operation": "aggregate" }, "DL Speed": { "aggregations": [ "mean" ] }, "Packet Loss": { "aggregations": [ "mean" ] }, "Ping": { "aggregations": [ "mean" ] }, "Ping (ms)": { "aggregations": [ "mean" ], "operation": "aggregate" }, "Ping jitter": { "aggregations": [ "mean" ] }, "Server ID": { "aggregations": [] }, "Server Name": { "aggregations": [] }, "Time": { "aggregations": [] }, "UL (Mbit/s)": { "aggregations": [ "mean" ], "operation": "aggregate" }, "UL Speed": { "aggregations": [ "mean" ] } } } } ], "type": "table" } ], "refresh": "15m", "schemaVersion": 39, "tags": [ "speedtest-tracker-v2", "influxdb2", "Flux" ], "templating": { "list": [ { "current": { "selected": false, "text": "_monitoring", "value": "_monitoring" }, "datasource": { "type": "influxdb", "uid": "Speedtests" }, "definition": "buckets()", "hide": 0, "includeAll": false, "multi": false, "name": "bucket", "options": [], "query": "buckets()", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 5, "type": "query" } ] }, "time": { "from": "now-24h", "to": "now" }, "timeRangeUpdatedDuringEditOrView": false, "timepicker": { "refresh_intervals": [ "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ] }, "timezone": "", "title": "Speedtest Tracker v2", "uid": "AX734aDLp", "version": 14, "weekStart": "" } ```