Commit 38475d6c authored by k.elaammari's avatar k.elaammari
Browse files

grafana setup idempotent

parent 521fc242
......@@ -5,7 +5,7 @@
},
"id": null,
"uid": null,
"uid": "default_dashboard_monitoring",
"title": "Monitoring",
"description": "",
"tags": ["node_exporter", "monitoring"],
......@@ -16,788 +16,7 @@
"graphTooltip": 0,
"refresh": false,
"panels": [
{
"columns": [],
"fontSize": "100%",
"gridPos": {
"h": 12,
"w": 3,
"x": 0,
"y": 0
},
"id": 9,
"links": [],
"options": {},
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 1,
"desc": false
},
"styles": [
{
"alias": "state",
"colorMode": "value",
"colors": [
"rgba(245, 54, 54, 0.9)",
"#37872D",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"mappingType": 1,
"pattern": "last",
"thresholds": [
"0.5"
],
"type": "string",
"unit": "short",
"valueMaps": [
{
"text": "Up",
"value": "1"
},
{
"text": "Down",
"value": "0"
}
]
},
{
"alias": "instance",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "instance",
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Time",
"thresholds": [],
"type": "hidden",
"unit": "short"
}
],
"targets": [
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT last(\"value\") FROM \"up\" WHERE (\"job\" = 'vm' AND \"group\" = 'monitoring') AND $timeFilter GROUP BY \"instance\" fill(previous)",
"rawQuery": true,
"refId": "A",
"resultFormat": "table",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"timeFrom": null,
"timeShift": null,
"title": "State",
"transform": "table",
"type": "table"
},
{
"aliasColors": {
"load": "dark-red"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "InfluxDB",
"description": "",
"fill": 1,
"gridPos": {
"h": 12,
"w": 5,
"x": 3,
"y": 0
},
"id": 17,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 3,
"links": [],
"maxPerRow": 4,
"nullPointMode": "null",
"options": {},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"repeat": null,
"repeatDirection": "h",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "load",
"groupBy": [
{
"params": [
"10s"
],
"type": "time"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "node_cpu",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT derivative(sum(\"value\"), 1s) FROM \"autogen\".\"node_cpu_seconds_total\" WHERE (\"job\" = 'vm' AND \"instance\" =~ /^$instance$/ AND \"mode\" != 'idle') AND $timeFilter GROUP BY time(10s) fill(linear)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "sum"
},
{
"params": [
"1s"
],
"type": "derivative"
}
]
],
"tags": [
{
"key": "job",
"operator": "=",
"value": "vm"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$instance$/"
},
{
"condition": "AND",
"key": "mode",
"operator": "!=",
"value": "idle"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CPU",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 1,
"format": "percentunit",
"label": "",
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"free": "dark-green",
"total": "dark-blue"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "InfluxDB",
"fill": 1,
"gridPos": {
"h": 12,
"w": 5,
"x": 8,
"y": 0
},
"id": 11,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 3,
"links": [],
"nullPointMode": "connected",
"options": {},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "total",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "node_memory_MemTotal_bytes",
"orderByTime": "ASC",
"policy": "autogen",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "instance",
"operator": "=~",
"value": "/^$instance$/"
}
]
},
{
"alias": "free",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "node_memory_MemFree_bytes",
"orderByTime": "ASC",
"policy": "default",
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "instance",
"operator": "=~",
"value": "/^$instance$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Memory",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": null,
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"receive": "dark-blue",
"transmit": "dark-purple"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"decimals": null,
"fill": 1,
"gridPos": {
"h": 12,
"w": 7,
"x": 13,
"y": 0
},
"id": 19,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 3,
"links": [],
"nullPointMode": "null",
"options": {},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "transmit",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "node_network_transmit_bytes",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (0-derivative(mean(\"value\"), 1s)) FROM \"node_network_transmit_bytes_total\" WHERE (\"instance\" =~ /^$instance$/ AND \"device\" = 'eth1' AND \"job\" = 'vm') AND $timeFilter GROUP BY time($__interval) fill(linear)",
"rawQuery": true,
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "derivative"
}
]
],
"tags": [
{
"key": "instance",
"operator": "=~",
"value": "/^$instance$/"
},
{
"condition": "AND",
"key": "device",
"operator": "=",
"value": "eth1"
},
{
"condition": "AND",
"key": "job",
"operator": "=",
"value": "vm"
}
]
},
{
"alias": "receive",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "node_network_receive_bytes_total",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},