nightscout / cgm-remote-monitor

nightscout web monitor
GNU Affero General Public License v3.0
2.43k stars 71.8k forks source link

REST-API Endpoints for Grafana #6061

Open fschmittlein opened 4 years ago

fschmittlein commented 4 years ago

I would like to display the data from Nightscout using Grafana. Unfortunately the right API endpoints are missing.

Grafana-Plugin: https://grafana.com/grafana/plugins/simpod-json-datasource API To work with this datasource the backend needs to implement 4 endpoints:

GET / with 200 status code response. Used for "Test connection" on the datasource config page. POST /search returning available metrics when invoked. POST /query returning metrics based on input. POST /annotations returning annotations. Those two urls are optional:

POST /tag-keys returning tag keys for ad hoc filters. POST /tag-values returning tag values for ad hoc filters.

sulkaharo commented 4 years ago

So.. Maybe find a developer to add this feature. :)

archynet commented 2 years ago

Hi @fschmittlein I work a bit on grafana with Nightscout and I have a dashboard that begins to look like something interesting. image hit me up if you want to know more or if you want the dashboard

JohhnyP commented 2 years ago

@archynet would you please share the dashboard? Thank you

MoeSaidi commented 1 year ago

Hi @fschmittlein I work a bit on grafana with Nightscout and I have a dashboard that begins to look like something interesting. image hit me up if you want to know more or if you want the dashboard

This is something I'm starting to work towards. Do you have any references to share? If you can I'd love to see a copy of your XML as well for Grafana.

The downside is that in Canada the Tandem pump does not talk to the app yet so I have no way to get the data from Tandem T:SLIM (IOB, Pump suspends, etc..) so the only data available now is the Dexcom sugar readings to start. Hoping the app gets approved soon!

Unless of course you have some other suggestions around this?

archynet commented 1 year ago

Hi to be honest I don't use this dashboard because I always come back to NightScout which is more convenient for me. This dashboard needs a mongodb proxy to get the data from Nightscout and it's not "optimal"

Anyway here is the dashboard { "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": "", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 17, "links": [ { "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": false, "tags": [], "targetBlank": true, "title": "NightScout title", "tooltip": "", "type": "link", "url": "https://nightscoutURL" } ], "liveNow": true, "panels": [ { "collapsed": false, "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 11, "panels": [], "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "refId": "A" } ], "title": "NightScout MongoDB", "type": "row" }, { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-BlPu", "seriesBy": "last" }, "custom": { "axisGridShow": false, "axisLabel": "", "axisPlacement": "auto", "axisSoftMax": 180, "axisSoftMin": 70, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 20, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "smooth", "lineStyle": { "fill": "solid" }, "lineWidth": 3, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "line" } }, "mappings": [], "noValue": "-", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "light-red", "value": 70 }, { "color": "light-red", "value": 180 } ] }, "unit": "conmgdL" }, "overrides": [] }, "gridPos": { "h": 14, "w": 24, "x": 0, "y": 1 }, "id": 7, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "8.3.3", "targets": [ { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "rawQuery": true, "refId": "A", "target": "db.entries.aggregate([\n\t{\"$match\": {}},\n\t{\"$project\": {\"date\": \"$dateString\", \"Glycémie\": \"$sgv\", \"_id\": 0}}\n])", "type": "table" } ], "title": "Continuous Glucose Monitoring", "transparent": true, "type": "timeseries" }, { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "dark-red", "value": 20 }, { "color": "dark-red", "value": 40 }, { "color": "dark-yellow", "value": 50 }, { "color": "dark-green", "value": 70 }, { "color": "dark-yellow", "value": 180 }, { "color": "light-red", "value": 220 }, { "color": "semi-dark-red", "value": 300 }, { "color": "dark-red", "value": 350 } ] }, "unit": "conmgdL" }, "overrides": [] }, "gridPos": { "h": 4, "w": 6, "x": 0, "y": 15 }, "id": 4, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "rawQuery": true, "refId": "A", "target": "db.entries.aggregate([\n\t{\"$match\": {}},\n\t{\"$project\": {\"date\": \"$dateString\", \"sgv\": \"$sgv\", \"_id\": 0}}\n])", "type": "table" } ], "title": "Current", "type": "stat" }, { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "displayMode": "color-text", "filterable": false, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "date" }, "properties": [ { "id": "custom.width", "value": 178 } ] }, { "matcher": { "id": "byName", "options": "Type" }, "properties": [ { "id": "custom.width", "value": 119 } ] } ] }, "gridPos": { "h": 8, "w": 10, "x": 8, "y": 15 }, "id": 9, "options": { "footer": { "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": false, "sortBy": [ { "desc": true, "displayName": "date" } ] }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "rawQuery": true, "refId": "A", "target": "db.treatments.aggregate([\n\t{\"$match\": {}},\n\t{\"$project\": {\"date\": \"$created_at\", \"Type\": \"$eventType\", \"Note\": \"$notes\", \"_id\": 0}}\n])", "type": "table" } ], "title": "Treatments", "type": "table" }, { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "dark-red", "value": 0 }, { "color": "semi-dark-red", "value": 10 }, { "color": "light-red", "value": 20 }, { "color": "super-light-red", "value": 30 }, { "color": "dark-yellow", "value": 40 }, { "color": "semi-dark-yellow", "value": 50 }, { "color": "light-yellow", "value": 60 }, { "color": "light-green", "value": 70 }, { "color": "semi-dark-green", "value": 80 }, { "color": "dark-green", "value": 90 }, { "color": "dark-green", "value": 100 } ] }, "unit": "%" }, "overrides": [] }, "gridPos": { "h": 4, "w": 2, "x": 20, "y": 15 }, "id": 15, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "rawQuery": true, "refId": "A", "target": "db.devicestatus.aggregate([\n\t{\"$match\": {}},\n\t{\"$project\": {\"date\": \"$created_at\",\"Battery\": \"$uploaderBattery\", \"_id\": 0}}\n])", "type": "table" } ], "title": "Uploader battery life", "type": "stat" }, { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "dark-red", "value": 0 }, { "color": "semi-dark-red", "value": 10 }, { "color": "light-red", "value": 20 }, { "color": "super-light-red", "value": 30 }, { "color": "dark-yellow", "value": 40 }, { "color": "semi-dark-yellow", "value": 50 }, { "color": "light-yellow", "value": 60 }, { "color": "light-green", "value": 70 }, { "color": "semi-dark-green", "value": 80 }, { "color": "dark-green", "value": 90 }, { "color": "dark-green", "value": 100 } ] }, "unit": "%" }, "overrides": [] }, "gridPos": { "h": 4, "w": 2, "x": 22, "y": 15 }, "id": 41, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "rawQuery": true, "refId": "A", "target": "db.devicestatus.aggregate([\n\t{\"$match\": {}},\n\t{\"$project\": {\"date\": \"$created_at\" ,\"pump\": \"$pump.battery.percent\", \"_id\": 0}}\n])", "type": "table" } ], "title": "Pump battery life", "type": "stat" }, { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "fieldConfig": { "defaults": { "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "light-purple", "value": null } ] }, "unit": "U" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 0, "y": 19 }, "id": 43, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "rawQuery": true, "refId": "A", "target": "db.devicestatus.aggregate([\n\t{\"$match\": {}},\n\t{\"$project\": {\"date\": \"$created_at\" ,\"BWP\": \"$pump.iob.bolusiob\", \"_id\": 0}}\n])", "type": "table" } ], "title": "IOB Active Insuline", "type": "stat" }, { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "fieldConfig": { "defaults": { "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "U" }, "overrides": [] }, "gridPos": { "h": 4, "w": 3, "x": 3, "y": 19 }, "id": 44, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "grafana-mongodb-datasource", "uid": "PQiPhy07k" }, "rawQuery": true, "refId": "A", "target": "db.devicestatus.aggregate([\n\t{\"$match\": {}},\n\t{\"$project\": {\"date\": \"$created_at\" ,\"BWP\": \"$pump.reservoir\", \"_id\": 0}}\n])", "type": "table" } ], "title": "Insulin Reservoir", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Total RAM", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 0, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 20, "y": 19 }, "id": 32, "links": [], "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}", "intervalFactor": 1, "refId": "A", "step": 240 } ], "title": "RAM Total", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Total SWAP", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 0, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 22, "y": 19 }, "id": 34, "links": [], "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"}", "intervalFactor": 1, "refId": "A", "step": 240 } ], "title": "SWAP Total", "type": "stat" }, { "collapsed": false, "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 23 }, "id": 13, "panels": [], "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "refId": "A" } ], "title": "GCM02", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "gridPos": { "h": 6, "w": 3, "x": 0, "y": 24 }, "id": 38, "options": { "content": "<img src=\"https://brandslogos.com/wp-content/uploads/images/large/ubuntu-logo.png\" width=150>\t\n", "mode": "html" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "refId": "A" } ], "title": "GCM02", "type": "text" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Busy state of all CPU cores together", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 85 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 95 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 3, "y": 24 }, "id": 18, "links": [], "options": { "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "(((count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))) - avg(sum by (mode)(rate(node_cpu_seconds_total{mode='idle',instance=\"$node\",job=\"$job\"}[$__rate_interval])))) 100) / count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", "hide": false, "intervalFactor": 1, "legendFormat": "", "refId": "A", "step": 240 } ], "title": "CPU Busy", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Busy state of all CPU cores together (15 min average)", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 85 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 95 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 6, "y": 24 }, "id": 20, "links": [], "options": { "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "avg(node_load15{instance=\"$node\",job=\"$job\"}) / count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)) 100", "hide": false, "intervalFactor": 1, "refId": "A", "step": 240 } ], "title": "Sys Load (15m avg)", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Used Swap", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 10 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 25 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 9, "y": 24 }, "id": 36, "links": [], "options": { "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "((node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}) / (node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} )) 100", "intervalFactor": 1, "refId": "A", "step": 240 } ], "title": "SWAP Used", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Non available RAM memory", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 0, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 80 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 12, "y": 24 }, "hideTimeOverride": false, "id": 22, "links": [], "options": { "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "((node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}) / (node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} )) 100", "format": "time_series", "hide": true, "intervalFactor": 1, "refId": "A", "step": 240 }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "100 - ((node_memory_MemAvailable_bytes{instance=\"$node\",job=\"$job\"} 100) / node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"})", "format": "time_series", "hide": false, "intervalFactor": 1, "refId": "B", "step": 240 } ], "title": "RAM Used", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Used Root FS", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 80 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 15, "y": 24 }, "id": 24, "links": [], "options": { "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "100 - ((node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"} 100) / node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"})", "format": "time_series", "intervalFactor": 1, "refId": "A", "step": 240 } ], "title": "Root FS Used", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Total number of CPU cores", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 18, "y": 24 }, "id": 26, "links": [], "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", "interval": "", "intervalFactor": 1, "legendFormat": "", "refId": "A", "step": 240 } ], "title": "CPU Cores", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "System uptime", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 20, "y": 24 }, "hideTimeOverride": true, "id": 28, "links": [], "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "node_time_seconds{instance=\"$node\",job=\"$job\"} - node_boot_time_seconds{instance=\"$node\",job=\"$job\"}", "intervalFactor": 1, "refId": "A", "step": 240 } ], "title": "Uptime", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "description": "Total RootFS", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 0, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "rgba(50, 172, 45, 0.97)", "value": null }, { "color": "rgba(237, 129, 40, 0.89)", "value": 70 }, { "color": "rgba(245, 54, 54, 0.9)", "value": 90 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 3, "w": 2, "x": 18, "y": 27 }, "id": 30, "links": [], "maxDataPoints": 100, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.0.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"}", "format": "time_series", "hide": false, "intervalFactor": 1, "refId": "A", "step": 240 } ], "title": "RootFS Total", "type": "stat" }, { "collapsed": false, "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 30 }, "id": 46, "panels": [], "targets": [ { "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "refId": "A" } ], "title": "Pending", "type": "row" } ], "refresh": "5m", "schemaVersion": 36, "style": "dark", "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "default", "value": "default" }, "hide": 0, "includeAll": false, "label": "datasource", "multi": false, "name": "DS_PROMETHEUS", "options": [], "query": "prometheus", "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" }, { "current": { "selected": true, "text": "node", "value": "node" }, "datasource": { "type": "prometheus", "uid": "FqrX1s07k" }, "definition": "label_values(node_uname_info, job)", "hide": 0, "includeAll": false, "label": "Job", "multi": false, "name": "job", "options": [], "query": { "query": "label_values(node_uname_info, job)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { "selected": false, "text": "localhost:9100", "value": "localhost:9100" }, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(node_uname_info{job=\"$job\"}, instance)", "hide": 0, "includeAll": false, "label": "Host:", "multi": false, "name": "node", "options": [], "query": { "query": "label_values(node_uname_info{job=\"$job\"}, instance)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { "selected": false, "text": "[a-z]+|nvme[0-9]+n[0-9]+", "value": "[a-z]+|nvme[0-9]+n[0-9]+" }, "hide": 2, "includeAll": false, "multi": false, "name": "diskdevices", "options": [ { "selected": true, "text": "[a-z]+|nvme[0-9]+n[0-9]+", "value": "[a-z]+|nvme[0-9]+n[0-9]+" } ], "query": "[a-z]+|nvme[0-9]+n[0-9]+", "skipUrlSync": false, "type": "custom" } ] }, "time": { "from": "now-12h", "to": "now" }, "timepicker": { "hidden": false }, "timezone": "", "title": "NightScout Copy", "uid": "EJlIaPTVz", "version": 1, "weekStart": "" }

MoeSaidi commented 1 year ago

Thanks, I was able to get some of these working but see that its not really the best configuration given the proxy (Found the node setup for a proxy)

There are enterprise versions of MongoDB Grafana plugin though, will need to dig into that more