kube-prometheus: remove duplication in grafana dashboards
Datasource links were duplicated in the grafana dashboads. This now also allows exporting grafana dashboards from the UI and just dropping them into the assets directory and they will be wrapped by the manifest generation script.
This commit is contained in:
@@ -1,39 +1,37 @@
|
|||||||
{
|
|
||||||
"dashboard":
|
|
||||||
{
|
{
|
||||||
"__inputs": [
|
"__inputs": [
|
||||||
{
|
{
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"label": "prometheus",
|
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "datasource",
|
"label": "prometheus",
|
||||||
|
"name": "DS_PROMETHEUS",
|
||||||
"pluginId": "prometheus",
|
"pluginId": "prometheus",
|
||||||
"pluginName": "Prometheus"
|
"pluginName": "Prometheus",
|
||||||
|
"type": "datasource"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"__requires": [
|
"__requires": [
|
||||||
{
|
{
|
||||||
"type": "grafana",
|
|
||||||
"id": "grafana",
|
"id": "grafana",
|
||||||
"name": "Grafana",
|
"name": "Grafana",
|
||||||
|
"type": "grafana",
|
||||||
"version": "4.1.1"
|
"version": "4.1.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "graph",
|
"id": "graph",
|
||||||
"name": "Graph",
|
"name": "Graph",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "datasource",
|
|
||||||
"id": "prometheus",
|
"id": "prometheus",
|
||||||
"name": "Prometheus",
|
"name": "Prometheus",
|
||||||
|
"type": "datasource",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "singlestat",
|
"id": "singlestat",
|
||||||
"name": "Singlestat",
|
"name": "Singlestat",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -847,14 +845,4 @@
|
|||||||
"timezone": "browser",
|
"timezone": "browser",
|
||||||
"title": "All Nodes",
|
"title": "All Nodes",
|
||||||
"version": 1
|
"version": 1
|
||||||
},
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"pluginId": "prometheus",
|
|
||||||
"type": "datasource",
|
|
||||||
"value": "prometheus"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"overwrite": true
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +1,48 @@
|
|||||||
{
|
{
|
||||||
"dashboard": {
|
|
||||||
"__inputs": [
|
"__inputs": [
|
||||||
{
|
{
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"label": "prometheus",
|
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "datasource",
|
"label": "prometheus",
|
||||||
|
"name": "DS_PROMETHEUS",
|
||||||
"pluginId": "prometheus",
|
"pluginId": "prometheus",
|
||||||
"pluginName": "Prometheus"
|
"pluginName": "Prometheus",
|
||||||
|
"type": "datasource"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"__requires": [
|
"__requires": [
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "singlestat",
|
"id": "singlestat",
|
||||||
"name": "Singlestat",
|
"name": "Singlestat",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "graph",
|
"id": "graph",
|
||||||
"name": "Graph",
|
"name": "Graph",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "grafana",
|
|
||||||
"id": "grafana",
|
"id": "grafana",
|
||||||
"name": "Grafana",
|
"name": "Grafana",
|
||||||
|
"type": "grafana",
|
||||||
"version": "3.1.1"
|
"version": "3.1.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "datasource",
|
|
||||||
"id": "prometheus",
|
"id": "prometheus",
|
||||||
"name": "Prometheus",
|
"name": "Prometheus",
|
||||||
|
"type": "datasource",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": null,
|
"annotations": {
|
||||||
"title": "Deployment",
|
"list": []
|
||||||
"tags": [],
|
},
|
||||||
"style": "dark",
|
|
||||||
"timezone": "browser",
|
|
||||||
"editable": true,
|
"editable": true,
|
||||||
|
"gnetId": null,
|
||||||
"hideControls": false,
|
"hideControls": false,
|
||||||
"sharedCrosshair": true,
|
"id": null,
|
||||||
|
"links": [],
|
||||||
"rows": [
|
"rows": [
|
||||||
{
|
{
|
||||||
"collapse": false,
|
"collapse": false,
|
||||||
@@ -51,37 +50,107 @@
|
|||||||
"height": "200px",
|
"height": "200px",
|
||||||
"panels": [
|
"panels": [
|
||||||
{
|
{
|
||||||
"title": "CPU",
|
"cacheTimeout": null,
|
||||||
"error": false,
|
"colorBackground": false,
|
||||||
"span": 4,
|
"colorValue": false,
|
||||||
|
"colors": [
|
||||||
|
"rgba(245, 54, 54, 0.9)",
|
||||||
|
"rgba(237, 129, 40, 0.89)",
|
||||||
|
"rgba(50, 172, 45, 0.97)"
|
||||||
|
],
|
||||||
|
"datasource": "${DS_PROMETHEUS}",
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"type": "singlestat",
|
"error": false,
|
||||||
"isNew": true,
|
"format": "none",
|
||||||
|
"gauge": {
|
||||||
|
"maxValue": 100,
|
||||||
|
"minValue": 0,
|
||||||
|
"show": false,
|
||||||
|
"thresholdLabels": false,
|
||||||
|
"thresholdMarkers": true
|
||||||
|
},
|
||||||
"id": 8,
|
"id": 8,
|
||||||
|
"interval": null,
|
||||||
|
"isNew": true,
|
||||||
|
"links": [],
|
||||||
|
"mappingType": 1,
|
||||||
|
"mappingTypes": [
|
||||||
|
{
|
||||||
|
"name": "value to text",
|
||||||
|
"value": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "range to text",
|
||||||
|
"value": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"maxDataPoints": 100,
|
||||||
|
"nullPointMode": "connected",
|
||||||
|
"nullText": null,
|
||||||
|
"postfix": "cores",
|
||||||
|
"postfixFontSize": "50%",
|
||||||
|
"prefix": "",
|
||||||
|
"prefixFontSize": "50%",
|
||||||
|
"rangeMaps": [
|
||||||
|
{
|
||||||
|
"from": "null",
|
||||||
|
"text": "N/A",
|
||||||
|
"to": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"span": 4,
|
||||||
|
"sparkline": {
|
||||||
|
"fillColor": "rgba(31, 118, 189, 0.18)",
|
||||||
|
"full": false,
|
||||||
|
"lineColor": "rgb(31, 120, 193)",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"refId": "A",
|
|
||||||
"expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}[3m])) ",
|
"expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}[3m])) ",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
|
"refId": "A",
|
||||||
"step": 600
|
"step": 600
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"thresholds": "",
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"title": "CPU",
|
||||||
"maxDataPoints": 100,
|
"type": "singlestat",
|
||||||
"interval": null,
|
"valueFontSize": "110%",
|
||||||
"cacheTimeout": null,
|
|
||||||
"format": "none",
|
|
||||||
"prefix": "",
|
|
||||||
"postfix": "cores",
|
|
||||||
"nullText": null,
|
|
||||||
"valueMaps": [
|
"valueMaps": [
|
||||||
{
|
{
|
||||||
"value": "null",
|
|
||||||
"op": "=",
|
"op": "=",
|
||||||
"text": "N/A"
|
"text": "N/A",
|
||||||
|
"value": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"valueName": "avg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cacheTimeout": null,
|
||||||
|
"colorBackground": false,
|
||||||
|
"colorValue": false,
|
||||||
|
"colors": [
|
||||||
|
"rgba(245, 54, 54, 0.9)",
|
||||||
|
"rgba(237, 129, 40, 0.89)",
|
||||||
|
"rgba(50, 172, 45, 0.97)"
|
||||||
|
],
|
||||||
|
"datasource": "${DS_PROMETHEUS}",
|
||||||
|
"editable": true,
|
||||||
|
"error": false,
|
||||||
|
"format": "none",
|
||||||
|
"gauge": {
|
||||||
|
"maxValue": 100,
|
||||||
|
"minValue": 0,
|
||||||
|
"show": false,
|
||||||
|
"thresholdLabels": false,
|
||||||
|
"thresholdMarkers": true
|
||||||
|
},
|
||||||
|
"id": 9,
|
||||||
|
"interval": null,
|
||||||
|
"isNew": true,
|
||||||
|
"links": [],
|
||||||
|
"mappingType": 1,
|
||||||
"mappingTypes": [
|
"mappingTypes": [
|
||||||
{
|
{
|
||||||
"name": "value to text",
|
"name": "value to text",
|
||||||
@@ -92,73 +161,73 @@
|
|||||||
"value": 2
|
"value": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"maxDataPoints": 100,
|
||||||
|
"nullPointMode": "connected",
|
||||||
|
"nullText": null,
|
||||||
|
"postfix": "GB",
|
||||||
|
"postfixFontSize": "50%",
|
||||||
|
"prefix": "",
|
||||||
|
"prefixFontSize": "80%",
|
||||||
"rangeMaps": [
|
"rangeMaps": [
|
||||||
{
|
{
|
||||||
"from": "null",
|
"from": "null",
|
||||||
"to": "null",
|
"text": "N/A",
|
||||||
"text": "N/A"
|
"to": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mappingType": 1,
|
"span": 4,
|
||||||
"nullPointMode": "connected",
|
|
||||||
"valueName": "avg",
|
|
||||||
"prefixFontSize": "50%",
|
|
||||||
"valueFontSize": "110%",
|
|
||||||
"postfixFontSize": "50%",
|
|
||||||
"thresholds": "",
|
|
||||||
"colorBackground": false,
|
|
||||||
"colorValue": false,
|
|
||||||
"colors": [
|
|
||||||
"rgba(245, 54, 54, 0.9)",
|
|
||||||
"rgba(237, 129, 40, 0.89)",
|
|
||||||
"rgba(50, 172, 45, 0.97)"
|
|
||||||
],
|
|
||||||
"sparkline": {
|
"sparkline": {
|
||||||
"show": true,
|
"fillColor": "rgba(31, 118, 189, 0.18)",
|
||||||
"full": false,
|
"full": false,
|
||||||
"lineColor": "rgb(31, 120, 193)",
|
"lineColor": "rgb(31, 120, 193)",
|
||||||
"fillColor": "rgba(31, 118, 189, 0.18)"
|
"show": true
|
||||||
},
|
},
|
||||||
"gauge": {
|
|
||||||
"show": false,
|
|
||||||
"minValue": 0,
|
|
||||||
"maxValue": 100,
|
|
||||||
"thresholdMarkers": true,
|
|
||||||
"thresholdLabels": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Memory",
|
|
||||||
"error": false,
|
|
||||||
"span": 4,
|
|
||||||
"editable": true,
|
|
||||||
"type": "singlestat",
|
|
||||||
"isNew": true,
|
|
||||||
"id": 9,
|
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"refId": "A",
|
|
||||||
"expr": "sum(container_memory_usage_bytes{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}) / 1024^3",
|
"expr": "sum(container_memory_usage_bytes{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}) / 1024^3",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
|
"refId": "A",
|
||||||
"step": 600
|
"step": 600
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"thresholds": "",
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"title": "Memory",
|
||||||
"maxDataPoints": 100,
|
"type": "singlestat",
|
||||||
"interval": null,
|
"valueFontSize": "110%",
|
||||||
"cacheTimeout": null,
|
|
||||||
"format": "none",
|
|
||||||
"prefix": "",
|
|
||||||
"postfix": "GB",
|
|
||||||
"nullText": null,
|
|
||||||
"valueMaps": [
|
"valueMaps": [
|
||||||
{
|
{
|
||||||
"value": "null",
|
|
||||||
"op": "=",
|
"op": "=",
|
||||||
"text": "N/A"
|
"text": "N/A",
|
||||||
|
"value": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"valueName": "avg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cacheTimeout": null,
|
||||||
|
"colorBackground": false,
|
||||||
|
"colorValue": false,
|
||||||
|
"colors": [
|
||||||
|
"rgba(245, 54, 54, 0.9)",
|
||||||
|
"rgba(237, 129, 40, 0.89)",
|
||||||
|
"rgba(50, 172, 45, 0.97)"
|
||||||
|
],
|
||||||
|
"datasource": "${DS_PROMETHEUS}",
|
||||||
|
"editable": true,
|
||||||
|
"error": false,
|
||||||
|
"format": "Bps",
|
||||||
|
"gauge": {
|
||||||
|
"maxValue": 100,
|
||||||
|
"minValue": 0,
|
||||||
|
"show": false,
|
||||||
|
"thresholdLabels": false,
|
||||||
|
"thresholdMarkers": false
|
||||||
|
},
|
||||||
|
"id": 7,
|
||||||
|
"interval": null,
|
||||||
|
"isNew": true,
|
||||||
|
"links": [],
|
||||||
|
"mappingType": 1,
|
||||||
"mappingTypes": [
|
"mappingTypes": [
|
||||||
{
|
{
|
||||||
"name": "value to text",
|
"name": "value to text",
|
||||||
@@ -169,161 +238,83 @@
|
|||||||
"value": 2
|
"value": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"maxDataPoints": 100,
|
||||||
|
"nullPointMode": "connected",
|
||||||
|
"nullText": null,
|
||||||
|
"postfix": "",
|
||||||
|
"postfixFontSize": "50%",
|
||||||
|
"prefix": "",
|
||||||
|
"prefixFontSize": "50%",
|
||||||
"rangeMaps": [
|
"rangeMaps": [
|
||||||
{
|
{
|
||||||
"from": "null",
|
"from": "null",
|
||||||
"to": "null",
|
"text": "N/A",
|
||||||
"text": "N/A"
|
"to": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mappingType": 1,
|
"span": 4,
|
||||||
"nullPointMode": "connected",
|
|
||||||
"valueName": "avg",
|
|
||||||
"prefixFontSize": "80%",
|
|
||||||
"valueFontSize": "110%",
|
|
||||||
"postfixFontSize": "50%",
|
|
||||||
"thresholds": "",
|
|
||||||
"colorBackground": false,
|
|
||||||
"colorValue": false,
|
|
||||||
"colors": [
|
|
||||||
"rgba(245, 54, 54, 0.9)",
|
|
||||||
"rgba(237, 129, 40, 0.89)",
|
|
||||||
"rgba(50, 172, 45, 0.97)"
|
|
||||||
],
|
|
||||||
"sparkline": {
|
"sparkline": {
|
||||||
"show": true,
|
"fillColor": "rgba(31, 118, 189, 0.18)",
|
||||||
"full": false,
|
"full": false,
|
||||||
"lineColor": "rgb(31, 120, 193)",
|
"lineColor": "rgb(31, 120, 193)",
|
||||||
"fillColor": "rgba(31, 118, 189, 0.18)"
|
"show": true
|
||||||
},
|
},
|
||||||
"gauge": {
|
|
||||||
"show": false,
|
|
||||||
"minValue": 0,
|
|
||||||
"maxValue": 100,
|
|
||||||
"thresholdMarkers": true,
|
|
||||||
"thresholdLabels": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Network",
|
|
||||||
"error": false,
|
|
||||||
"span": 4,
|
|
||||||
"editable": true,
|
|
||||||
"type": "singlestat",
|
|
||||||
"isNew": true,
|
|
||||||
"id": 7,
|
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"refId": "A",
|
|
||||||
"expr": "sum(rate(container_network_transmit_bytes_total{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}[3m])) + sum(rate(container_network_receive_bytes_total{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}[3m])) ",
|
"expr": "sum(rate(container_network_transmit_bytes_total{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}[3m])) + sum(rate(container_network_receive_bytes_total{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}[3m])) ",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
|
"refId": "A",
|
||||||
"step": 600
|
"step": 600
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"thresholds": "",
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"title": "Network",
|
||||||
"maxDataPoints": 100,
|
"type": "singlestat",
|
||||||
"interval": null,
|
"valueFontSize": "80%",
|
||||||
"cacheTimeout": null,
|
|
||||||
"format": "Bps",
|
|
||||||
"prefix": "",
|
|
||||||
"postfix": "",
|
|
||||||
"nullText": null,
|
|
||||||
"valueMaps": [
|
"valueMaps": [
|
||||||
{
|
{
|
||||||
"value": "null",
|
|
||||||
"op": "=",
|
"op": "=",
|
||||||
"text": "N/A"
|
"text": "N/A",
|
||||||
|
"value": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mappingTypes": [
|
"valueName": "avg"
|
||||||
{
|
}
|
||||||
"name": "value to text",
|
],
|
||||||
"value": 1
|
"showTitle": false,
|
||||||
|
"title": "Row"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "range to text",
|
|
||||||
"value": 2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"rangeMaps": [
|
|
||||||
{
|
|
||||||
"from": "null",
|
|
||||||
"to": "null",
|
|
||||||
"text": "N/A"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mappingType": 1,
|
|
||||||
"nullPointMode": "connected",
|
|
||||||
"valueName": "avg",
|
|
||||||
"prefixFontSize": "50%",
|
|
||||||
"valueFontSize": "80%",
|
|
||||||
"postfixFontSize": "50%",
|
|
||||||
"thresholds": "",
|
|
||||||
"colorBackground": false,
|
|
||||||
"colorValue": false,
|
|
||||||
"colors": [
|
|
||||||
"rgba(245, 54, 54, 0.9)",
|
|
||||||
"rgba(237, 129, 40, 0.89)",
|
|
||||||
"rgba(50, 172, 45, 0.97)"
|
|
||||||
],
|
|
||||||
"sparkline": {
|
|
||||||
"show": true,
|
|
||||||
"full": false,
|
|
||||||
"lineColor": "rgb(31, 120, 193)",
|
|
||||||
"fillColor": "rgba(31, 118, 189, 0.18)"
|
|
||||||
},
|
|
||||||
"gauge": {
|
|
||||||
"show": false,
|
|
||||||
"minValue": 0,
|
|
||||||
"maxValue": 100,
|
|
||||||
"thresholdMarkers": false,
|
|
||||||
"thresholdLabels": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"title": "Row",
|
|
||||||
"showTitle": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "New row",
|
|
||||||
"height": "100px",
|
|
||||||
"editable": true,
|
|
||||||
"collapse": false,
|
"collapse": false,
|
||||||
|
"editable": true,
|
||||||
|
"height": "100px",
|
||||||
"panels": [
|
"panels": [
|
||||||
{
|
{
|
||||||
"title": "Desired Replicas",
|
|
||||||
"error": false,
|
|
||||||
"span": 3,
|
|
||||||
"editable": true,
|
|
||||||
"type": "singlestat",
|
|
||||||
"isNew": true,
|
|
||||||
"id": 5,
|
|
||||||
"targets": [
|
|
||||||
{
|
|
||||||
"refId": "A",
|
|
||||||
"expr": "max(kube_deployment_spec_replicas{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance)",
|
|
||||||
"intervalFactor": 2,
|
|
||||||
"step": 600,
|
|
||||||
"metric": "kube_deployment_spec_replicas"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"links": [],
|
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
|
||||||
"maxDataPoints": 100,
|
|
||||||
"interval": null,
|
|
||||||
"cacheTimeout": null,
|
"cacheTimeout": null,
|
||||||
"format": "none",
|
"colorBackground": false,
|
||||||
"prefix": "",
|
"colorValue": false,
|
||||||
"postfix": "",
|
"colors": [
|
||||||
"nullText": null,
|
"rgba(245, 54, 54, 0.9)",
|
||||||
"valueMaps": [
|
"rgba(237, 129, 40, 0.89)",
|
||||||
{
|
"rgba(50, 172, 45, 0.97)"
|
||||||
"value": "null",
|
|
||||||
"op": "=",
|
|
||||||
"text": "N/A"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
"datasource": "${DS_PROMETHEUS}",
|
||||||
|
"decimals": null,
|
||||||
|
"editable": true,
|
||||||
|
"error": false,
|
||||||
|
"format": "none",
|
||||||
|
"gauge": {
|
||||||
|
"maxValue": 100,
|
||||||
|
"minValue": 0,
|
||||||
|
"show": false,
|
||||||
|
"thresholdLabels": false,
|
||||||
|
"thresholdMarkers": false
|
||||||
|
},
|
||||||
|
"id": 5,
|
||||||
|
"interval": null,
|
||||||
|
"isNew": true,
|
||||||
|
"links": [],
|
||||||
|
"mappingType": 1,
|
||||||
"mappingTypes": [
|
"mappingTypes": [
|
||||||
{
|
{
|
||||||
"name": "value to text",
|
"name": "value to text",
|
||||||
@@ -334,74 +325,74 @@
|
|||||||
"value": 2
|
"value": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"maxDataPoints": 100,
|
||||||
|
"nullPointMode": "connected",
|
||||||
|
"nullText": null,
|
||||||
|
"postfix": "",
|
||||||
|
"postfixFontSize": "50%",
|
||||||
|
"prefix": "",
|
||||||
|
"prefixFontSize": "50%",
|
||||||
"rangeMaps": [
|
"rangeMaps": [
|
||||||
{
|
{
|
||||||
"from": "null",
|
"from": "null",
|
||||||
"to": "null",
|
"text": "N/A",
|
||||||
"text": "N/A"
|
"to": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mappingType": 1,
|
"span": 3,
|
||||||
"nullPointMode": "connected",
|
|
||||||
"valueName": "avg",
|
|
||||||
"prefixFontSize": "50%",
|
|
||||||
"valueFontSize": "80%",
|
|
||||||
"postfixFontSize": "50%",
|
|
||||||
"thresholds": "",
|
|
||||||
"colorBackground": false,
|
|
||||||
"colorValue": false,
|
|
||||||
"colors": [
|
|
||||||
"rgba(245, 54, 54, 0.9)",
|
|
||||||
"rgba(237, 129, 40, 0.89)",
|
|
||||||
"rgba(50, 172, 45, 0.97)"
|
|
||||||
],
|
|
||||||
"sparkline": {
|
"sparkline": {
|
||||||
"show": false,
|
"fillColor": "rgba(31, 118, 189, 0.18)",
|
||||||
"full": false,
|
"full": false,
|
||||||
"lineColor": "rgb(31, 120, 193)",
|
"lineColor": "rgb(31, 120, 193)",
|
||||||
"fillColor": "rgba(31, 118, 189, 0.18)"
|
"show": false
|
||||||
},
|
},
|
||||||
"gauge": {
|
|
||||||
"show": false,
|
|
||||||
"minValue": 0,
|
|
||||||
"maxValue": 100,
|
|
||||||
"thresholdMarkers": false,
|
|
||||||
"thresholdLabels": false
|
|
||||||
},
|
|
||||||
"decimals": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Available Replicas",
|
|
||||||
"error": false,
|
|
||||||
"span": 3,
|
|
||||||
"editable": true,
|
|
||||||
"type": "singlestat",
|
|
||||||
"isNew": true,
|
|
||||||
"id": 6,
|
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"refId": "A",
|
"expr": "max(kube_deployment_spec_replicas{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance)",
|
||||||
"expr": "min(kube_deployment_status_replicas_available{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance)",
|
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
|
"metric": "kube_deployment_spec_replicas",
|
||||||
|
"refId": "A",
|
||||||
"step": 600
|
"step": 600
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"thresholds": "",
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"title": "Desired Replicas",
|
||||||
"maxDataPoints": 100,
|
"type": "singlestat",
|
||||||
"interval": null,
|
"valueFontSize": "80%",
|
||||||
"cacheTimeout": null,
|
|
||||||
"format": "none",
|
|
||||||
"prefix": "",
|
|
||||||
"postfix": "",
|
|
||||||
"nullText": null,
|
|
||||||
"valueMaps": [
|
"valueMaps": [
|
||||||
{
|
{
|
||||||
"value": "null",
|
|
||||||
"op": "=",
|
"op": "=",
|
||||||
"text": "N/A"
|
"text": "N/A",
|
||||||
|
"value": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"valueName": "avg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cacheTimeout": null,
|
||||||
|
"colorBackground": false,
|
||||||
|
"colorValue": false,
|
||||||
|
"colors": [
|
||||||
|
"rgba(245, 54, 54, 0.9)",
|
||||||
|
"rgba(237, 129, 40, 0.89)",
|
||||||
|
"rgba(50, 172, 45, 0.97)"
|
||||||
|
],
|
||||||
|
"datasource": "${DS_PROMETHEUS}",
|
||||||
|
"editable": true,
|
||||||
|
"error": false,
|
||||||
|
"format": "none",
|
||||||
|
"gauge": {
|
||||||
|
"maxValue": 100,
|
||||||
|
"minValue": 0,
|
||||||
|
"show": false,
|
||||||
|
"thresholdLabels": false,
|
||||||
|
"thresholdMarkers": true
|
||||||
|
},
|
||||||
|
"id": 6,
|
||||||
|
"interval": null,
|
||||||
|
"isNew": true,
|
||||||
|
"links": [],
|
||||||
|
"mappingType": 1,
|
||||||
"mappingTypes": [
|
"mappingTypes": [
|
||||||
{
|
{
|
||||||
"name": "value to text",
|
"name": "value to text",
|
||||||
@@ -412,40 +403,47 @@
|
|||||||
"value": 2
|
"value": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"maxDataPoints": 100,
|
||||||
|
"nullPointMode": "connected",
|
||||||
|
"nullText": null,
|
||||||
|
"postfix": "",
|
||||||
|
"postfixFontSize": "50%",
|
||||||
|
"prefix": "",
|
||||||
|
"prefixFontSize": "50%",
|
||||||
"rangeMaps": [
|
"rangeMaps": [
|
||||||
{
|
{
|
||||||
"from": "null",
|
"from": "null",
|
||||||
"to": "null",
|
"text": "N/A",
|
||||||
"text": "N/A"
|
"to": "null"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mappingType": 1,
|
"span": 3,
|
||||||
"nullPointMode": "connected",
|
|
||||||
"valueName": "avg",
|
|
||||||
"prefixFontSize": "50%",
|
|
||||||
"valueFontSize": "80%",
|
|
||||||
"postfixFontSize": "50%",
|
|
||||||
"thresholds": "",
|
|
||||||
"colorBackground": false,
|
|
||||||
"colorValue": false,
|
|
||||||
"colors": [
|
|
||||||
"rgba(245, 54, 54, 0.9)",
|
|
||||||
"rgba(237, 129, 40, 0.89)",
|
|
||||||
"rgba(50, 172, 45, 0.97)"
|
|
||||||
],
|
|
||||||
"sparkline": {
|
"sparkline": {
|
||||||
"show": false,
|
"fillColor": "rgba(31, 118, 189, 0.18)",
|
||||||
"full": false,
|
"full": false,
|
||||||
"lineColor": "rgb(31, 120, 193)",
|
"lineColor": "rgb(31, 120, 193)",
|
||||||
"fillColor": "rgba(31, 118, 189, 0.18)"
|
"show": false
|
||||||
},
|
},
|
||||||
"gauge": {
|
"targets": [
|
||||||
"show": false,
|
{
|
||||||
"minValue": 0,
|
"expr": "min(kube_deployment_status_replicas_available{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance)",
|
||||||
"maxValue": 100,
|
"intervalFactor": 2,
|
||||||
"thresholdMarkers": true,
|
"refId": "A",
|
||||||
"thresholdLabels": false
|
"step": 600
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"thresholds": "",
|
||||||
|
"title": "Available Replicas",
|
||||||
|
"type": "singlestat",
|
||||||
|
"valueFontSize": "80%",
|
||||||
|
"valueMaps": [
|
||||||
|
{
|
||||||
|
"op": "=",
|
||||||
|
"text": "N/A",
|
||||||
|
"value": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"valueName": "avg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cacheTimeout": null,
|
"cacheTimeout": null,
|
||||||
@@ -603,7 +601,8 @@
|
|||||||
],
|
],
|
||||||
"valueName": "avg"
|
"valueName": "avg"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"title": "New row"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapse": false,
|
"collapse": false,
|
||||||
@@ -628,12 +627,12 @@
|
|||||||
"legend": {
|
"legend": {
|
||||||
"avg": false,
|
"avg": false,
|
||||||
"current": false,
|
"current": false,
|
||||||
|
"hideZero": false,
|
||||||
"max": false,
|
"max": false,
|
||||||
"min": false,
|
"min": false,
|
||||||
"show": true,
|
"show": true,
|
||||||
"total": false,
|
"total": false,
|
||||||
"values": false,
|
"values": false
|
||||||
"hideZero": false
|
|
||||||
},
|
},
|
||||||
"lines": true,
|
"lines": true,
|
||||||
"linewidth": 2,
|
"linewidth": 2,
|
||||||
@@ -694,6 +693,7 @@
|
|||||||
"sort": 0,
|
"sort": 0,
|
||||||
"value_type": "cumulative"
|
"value_type": "cumulative"
|
||||||
},
|
},
|
||||||
|
"transparent": false,
|
||||||
"type": "graph",
|
"type": "graph",
|
||||||
"xaxis": {
|
"xaxis": {
|
||||||
"mode": "time",
|
"mode": "time",
|
||||||
@@ -718,43 +718,17 @@
|
|||||||
"min": null,
|
"min": null,
|
||||||
"show": false
|
"show": false
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"transparent": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"title": "New row",
|
|
||||||
"showTitle": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"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"
|
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
"showTitle": false,
|
||||||
|
"title": "New row"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"schemaVersion": 12,
|
||||||
|
"sharedCrosshair": true,
|
||||||
|
"style": "dark",
|
||||||
|
"tags": [],
|
||||||
"templating": {
|
"templating": {
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
@@ -797,21 +771,36 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"annotations": {
|
"time": {
|
||||||
"list": []
|
"from": "now-6h",
|
||||||
|
"to": "now"
|
||||||
},
|
},
|
||||||
"schemaVersion": 12,
|
"timepicker": {
|
||||||
"version": 2,
|
"refresh_intervals": [
|
||||||
"links": [],
|
"5s",
|
||||||
"gnetId": null
|
"10s",
|
||||||
},
|
"30s",
|
||||||
"inputs": [
|
"1m",
|
||||||
{
|
"5m",
|
||||||
"name": "DS_PROMETHEUS",
|
"15m",
|
||||||
"pluginId": "prometheus",
|
"30m",
|
||||||
"type": "datasource",
|
"1h",
|
||||||
"value": "prometheus"
|
"2h",
|
||||||
}
|
"1d"
|
||||||
],
|
],
|
||||||
"overwrite": true
|
"time_options": [
|
||||||
|
"5m",
|
||||||
|
"15m",
|
||||||
|
"1h",
|
||||||
|
"6h",
|
||||||
|
"12h",
|
||||||
|
"24h",
|
||||||
|
"2d",
|
||||||
|
"7d",
|
||||||
|
"30d"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"timezone": "browser",
|
||||||
|
"title": "Deployment",
|
||||||
|
"version": 2
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"dashboard": {
|
|
||||||
"__inputs": [
|
"__inputs": [
|
||||||
{
|
{
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -396,14 +395,4 @@
|
|||||||
"timezone": "browser",
|
"timezone": "browser",
|
||||||
"title": "Pods",
|
"title": "Pods",
|
||||||
"version": 26
|
"version": 26
|
||||||
},
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"pluginId": "prometheus",
|
|
||||||
"type": "datasource",
|
|
||||||
"value": "prometheus"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"overwrite": true
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,37 @@
|
|||||||
{
|
|
||||||
"dashboard":
|
|
||||||
{
|
{
|
||||||
"__inputs": [
|
"__inputs": [
|
||||||
{
|
{
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"label": "prometheus",
|
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "datasource",
|
"label": "prometheus",
|
||||||
|
"name": "DS_PROMETHEUS",
|
||||||
"pluginId": "prometheus",
|
"pluginId": "prometheus",
|
||||||
"pluginName": "Prometheus"
|
"pluginName": "Prometheus",
|
||||||
|
"type": "datasource"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"__requires": [
|
"__requires": [
|
||||||
{
|
{
|
||||||
"type": "grafana",
|
|
||||||
"id": "grafana",
|
"id": "grafana",
|
||||||
"name": "Grafana",
|
"name": "Grafana",
|
||||||
|
"type": "grafana",
|
||||||
"version": "4.1.1"
|
"version": "4.1.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "graph",
|
"id": "graph",
|
||||||
"name": "Graph",
|
"name": "Graph",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "datasource",
|
|
||||||
"id": "prometheus",
|
"id": "prometheus",
|
||||||
"name": "Prometheus",
|
"name": "Prometheus",
|
||||||
|
"type": "datasource",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "singlestat",
|
"id": "singlestat",
|
||||||
"name": "Singlestat",
|
"name": "Singlestat",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -867,14 +865,4 @@
|
|||||||
"timezone": "browser",
|
"timezone": "browser",
|
||||||
"title": "Nodes",
|
"title": "Nodes",
|
||||||
"version": 1
|
"version": 1
|
||||||
},
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"pluginId": "prometheus",
|
|
||||||
"type": "datasource",
|
|
||||||
"value": "prometheus"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"overwrite": true
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
{
|
{
|
||||||
"__inputs": [
|
"__inputs": [
|
||||||
{
|
{
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"label": "prometheus",
|
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "datasource",
|
"label": "prometheus",
|
||||||
|
"name": "DS_PROMETHEUS",
|
||||||
"pluginId": "prometheus",
|
"pluginId": "prometheus",
|
||||||
"pluginName": "Prometheus"
|
"pluginName": "Prometheus",
|
||||||
|
"type": "datasource"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"__requires": [
|
"__requires": [
|
||||||
{
|
{
|
||||||
"type": "grafana",
|
|
||||||
"id": "grafana",
|
"id": "grafana",
|
||||||
"name": "Grafana",
|
"name": "Grafana",
|
||||||
|
"type": "grafana",
|
||||||
"version": "4.1.1"
|
"version": "4.1.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "graph",
|
"id": "graph",
|
||||||
"name": "Graph",
|
"name": "Graph",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "datasource",
|
|
||||||
"id": "prometheus",
|
"id": "prometheus",
|
||||||
"name": "Prometheus",
|
"name": "Prometheus",
|
||||||
|
"type": "datasource",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
|
||||||
"id": "singlestat",
|
"id": "singlestat",
|
||||||
"name": "Singlestat",
|
"name": "Singlestat",
|
||||||
|
"type": "panel",
|
||||||
"version": ""
|
"version": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -8,7 +8,13 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
for f in assets/grafana/*
|
for f in assets/grafana/*-dashboard.json
|
||||||
|
do
|
||||||
|
echo " $(basename $f): |+"
|
||||||
|
hack/scripts/wrap-dashboard.sh $f | sed "s/^/ /g"
|
||||||
|
done
|
||||||
|
|
||||||
|
for f in assets/grafana/*-datasource.json
|
||||||
do
|
do
|
||||||
echo " $(basename $f): |+"
|
echo " $(basename $f): |+"
|
||||||
cat $f | sed "s/^/ /g"
|
cat $f | sed "s/^/ /g"
|
||||||
|
|||||||
@@ -8,12 +8,10 @@
|
|||||||
# has error.
|
# has error.
|
||||||
# * Download dashboard specification as JSON file in Grafana:
|
# * Download dashboard specification as JSON file in Grafana:
|
||||||
# Share -> Export -> Save to file.
|
# Share -> Export -> Save to file.
|
||||||
# * Wrap dashboard specification to make it digestable by kube-prometheus:
|
# * Drop dashboard specification in assets folder:
|
||||||
# ./hack/scripts/wrap-dashboard.sh Nodes-1488465802729.json
|
|
||||||
# * Replace dashboard specification:
|
|
||||||
# mv Nodes-1488465802729.json assets/grafana/node-dashboard.json
|
# mv Nodes-1488465802729.json assets/grafana/node-dashboard.json
|
||||||
# * Regenerate Grafana configmap:
|
# * Regenerate Grafana configmap:
|
||||||
# ./hack/scripts/generate-configmaps.sh
|
# ./hack/scripts/generate-manifests.sh
|
||||||
# * Apply new configmap:
|
# * Apply new configmap:
|
||||||
# kubectl -n monitoring apply -f manifests/grafana/grafana-cm.yaml
|
# kubectl -n monitoring apply -f manifests/grafana/grafana-cm.yaml
|
||||||
|
|
||||||
@@ -22,17 +20,16 @@ if [ "$#" -ne 1 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json=$1
|
dashboardjson=$1
|
||||||
temp=$(tempfile -m 0644)
|
|
||||||
|
|
||||||
cat >> $temp <<EOF
|
cat <<EOF
|
||||||
{
|
{
|
||||||
"dashboard":
|
"dashboard":
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat $json >> $temp
|
cat $dashboardjson
|
||||||
|
|
||||||
cat >> $temp <<EOF
|
cat <<EOF
|
||||||
,
|
,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
@@ -46,5 +43,3 @@ cat >> $temp <<EOF
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
mv $temp $json
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user