Skip to content

Instantly share code, notes, and snippets.

@yokoyama-flogics
Created August 11, 2023 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yokoyama-flogics/327b088b963881363a95eba3ab7c76ff to your computer and use it in GitHub Desktop.
Save yokoyama-flogics/327b088b963881363a95eba3ab7c76ff to your computer and use it in GitHub Desktop.
A sample dashboard for Grafana
{
"__inputs": [
{
"name": "DS_ELASTICSEARCH_POWER_METER",
"label": "Elasticsearch power_meter",
"description": "",
"type": "datasource",
"pluginId": "elasticsearch",
"pluginName": "Elasticsearch"
}
],
"__elements": {},
"__requires": [
{
"type": "datasource",
"id": "elasticsearch",
"name": "Elasticsearch",
"version": "1.0.0"
},
{
"type": "panel",
"id": "gauge",
"name": "Gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "10.0.3"
},
{
"type": "panel",
"id": "graph",
"name": "Graph (old)",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [
{
"options": {
"match": "null",
"result": {
"text": "N/A"
}
},
"type": "special"
}
],
"max": 600,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#299c46",
"value": null
},
{
"color": "rgba(237, 129, 40, 0.89)",
"value": 150
},
{
"color": "#d44a3a",
"value": 400
}
]
},
"unit": "watt"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 7,
"x": 0,
"y": 0
},
"hideTimeOverride": true,
"id": 8,
"links": [],
"maxDataPoints": 100,
"options": {
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "10.0.3",
"targets": [
{
"alias": "",
"bucketAggs": [
{
"field": "datetime",
"id": "2",
"settings": {
"interval": "auto",
"min_doc_count": 0,
"trimEdges": 0
},
"type": "date_histogram"
}
],
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"metrics": [
{
"field": "power",
"id": "1",
"meta": {},
"settings": {},
"type": "avg"
}
],
"query": "unit_id: atsu_aircon",
"refId": "A",
"timeField": "datetime"
}
],
"timeFrom": "30s",
"title": "Power",
"type": "gauge"
},
{
"aliasColors": {
"Average power": "#ea6460"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 6
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "10.0.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "Moving Average Average power",
"fill": 0
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"bucketAggs": [
{
"field": "datetime",
"id": "2",
"settings": {
"interval": "auto",
"min_doc_count": 0,
"trimEdges": 0
},
"type": "date_histogram"
}
],
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"hide": false,
"metrics": [
{
"field": "power",
"id": "1",
"meta": {},
"settings": {},
"type": "avg"
},
{
"field": "1",
"id": "3",
"meta": {},
"pipelineAgg": "1",
"settings": {
"minimize": false,
"model": "linear",
"window": 400
},
"type": "moving_avg"
}
],
"query": "unit_id: atsu_aircon",
"refId": "A",
"timeField": "datetime"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Power",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": "Watt",
"logBase": 1,
"show": true
},
{
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
},
{
"aliasColors": {
"Average voltage": "#1f78c1"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 14
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "10.0.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"bucketAggs": [
{
"field": "datetime",
"id": "2",
"settings": {
"interval": "auto",
"min_doc_count": 0,
"trimEdges": 0
},
"type": "date_histogram"
}
],
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"metrics": [
{
"field": "voltage",
"id": "1",
"meta": {},
"settings": {},
"type": "avg"
}
],
"query": "unit_id: atsu_aircon",
"refId": "A",
"timeField": "datetime"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Voltage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": "Volt",
"logBase": 1,
"max": "110",
"min": "90",
"show": true
},
{
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 19
},
"hiddenSeries": false,
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "10.0.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"bucketAggs": [
{
"field": "datetime",
"id": "2",
"settings": {
"interval": "auto",
"min_doc_count": 0,
"trimEdges": 0
},
"type": "date_histogram"
}
],
"datasource": {
"type": "elasticsearch",
"uid": "${DS_ELASTICSEARCH_POWER_METER}"
},
"metrics": [
{
"field": "current",
"id": "1",
"meta": {},
"settings": {},
"type": "avg"
}
],
"query": "unit_id: atsu_aircon",
"refId": "A",
"timeField": "datetime"
}
],
"thresholds": [],
"timeRegions": [],
"title": "Current",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"mode": "time",
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": "Ampere",
"logBase": 1,
"show": true
},
{
"format": "short",
"logBase": 1,
"show": true
}
],
"yaxis": {
"align": false
}
}
],
"refresh": "30s",
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Power Consumption (Atsu)",
"uid": "DHTHrtq4z",
"version": 10,
"weekStart": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment