diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..780327889b51bb60b76cc637a953c131928c14c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.6-slim + +RUN apt-get update -y && apt-get install -y git +RUN pip3 install virtualenv + +ENTRYPOINT ["/bin/bash"] \ No newline at end of file diff --git a/Makefile b/Makefile index 7941140839762bcba97a45ce292a76ec33a06687..a093ce7aa71d3356fb874c1365e5f67c7fdf98f3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,11 @@ -BUILDER := docker run --rm -it --workdir /data -v ${PWD}:/data debian:8 ./hack/scripts/generate-manifests.sh -generate: +.PHONY: image + +IMAGE := coreos/generate-prometheus-operator-manifests + +image: Dockerfile + docker build -t $(IMAGE) . + +BUILDER := docker run --rm -it --workdir /data -v ${PWD}:/data $(IMAGE) ./hack/scripts/generate-manifests.sh +generate: image @echo ">> Compiling assets and generating Kubernetes manifests" $(BUILDER) diff --git a/assets/grafana/.gitignore b/assets/grafana/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..047d127793496e3cf54afa7c390a462a42248165 --- /dev/null +++ b/assets/grafana/.gitignore @@ -0,0 +1 @@ +*-dashboard.json diff --git a/assets/grafana/_grafanalib.py b/assets/grafana/_grafanalib.py new file mode 100644 index 0000000000000000000000000000000000000000..f030f1012b79bccdf8dde11f48cee137dd3d7d84 --- /dev/null +++ b/assets/grafana/_grafanalib.py @@ -0,0 +1,92 @@ +from grafanalib import core +from grafanalib.core import Graph, Time, SparkLine, \ + Gauge, Templating, XAxis, YAxes + + +def Dashboard( + title, version, time, rows, graphTooltip=0, templating=None, +): + optional_args = {} + if templating is not None: + optional_args['templating'] = templating + return core.Dashboard( + title=title, refresh=None, schemaVersion=14, + version=version, time=time, timezone='browser', inputs=[ + { + 'name': 'DS_PROMETHEUS', + 'label': 'prometheus', + 'description': '', + 'type': 'datasource', + 'pluginId': 'prometheus', + 'pluginName': 'Prometheus' + }, + ], rows=rows, graphTooltip=graphTooltip, **optional_args, + ) + + +def Row( + panels, height=None, title='Dashboard Row', showTitle=False, + editable=None +): + assert isinstance(height, (type(None), int)) + return core.Row( + panels=panels, height=height, title=title, showTitle=showTitle, + titleSize='h6', editable=editable, + ) + + +def SingleStat( + title, id, targets, colorValue=False, gauge=Gauge(show=True), + valueFontSize='80%', thresholds=None, valueName='avg', valueMaps=None, + rangeMaps=None, mappingTypes=None, mappingType=None, postfix=None, + sparkline=SparkLine(), prefixFontSize='50%', colors=[ + (50, 172, 45, 0.97), + (237, 129, 40, 0.89), + (245, 54, 54, 0.9), + ], span=None, format='none', transparent=None, +): + def merge_target(target): + return {**{ + 'intervalFactor': 2, + 'refId': 'A', + 'step': 600, + }, **target} + targets = [merge_target(t) for t in targets] + + return core.SingleStat( + title=title, id=id, colorValue=colorValue, + dataSource='${DS_PROMETHEUS}', gauge=gauge, + valueFontSize=valueFontSize, thresholds=thresholds, + valueName=valueName, valueMaps=valueMaps, rangeMaps=rangeMaps, + mappingTypes=mappingTypes, targets=targets, + mappingType=mappingType, format=format, colors=colors, span=span, + postfix=postfix, sparkline=sparkline, prefixFontSize=prefixFontSize, + hideTimeOverride=None, transparent=transparent, + ) + + +def Graph( + id, title, targets, dashLength=None, dashes=False, spaceLength=None, + xAxis=None, yAxes=None, nullPointMode='connected', +): + def merge_target(target): + return {**{ + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, **target} + + targets = [merge_target(t) for t in targets] + assert isinstance(yAxes, YAxes) + return core.Graph( + id=id, title=title, dashLength=dashLength, dashes=dashes, + spaceLength=spaceLength, targets=targets, xAxis=xAxis, yAxes=yAxes, + dataSource='${DS_PROMETHEUS}', nullPointMode=nullPointMode, + ) + + +def YAxis(format='none', label='', min=0, show=True): + return core.YAxis( + format=format, label=label, min=min, show=show + ) diff --git a/assets/grafana/deployment-dashboard.json b/assets/grafana/deployment-dashboard.json deleted file mode 100644 index 1ec5a6d9ef1f8784ae0e2fdfd438f7ed8e8fcc3e..0000000000000000000000000000000000000000 --- a/assets/grafana/deployment-dashboard.json +++ /dev/null @@ -1,816 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - } - ], - "annotations": { - "list": [] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 1, - "hideControls": false, - "id": null, - "links": [], - "rows": [ - { - "collapse": false, - "height": "200px", - "panels": [ - { - "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": 8, - "interval": null, - "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 - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}[3m])) ", - "intervalFactor": 2, - "refId": "A", - "step": 600 - } - ], - "thresholds": "", - "title": "CPU", - "type": "singlestat", - "valueFontSize": "110%", - "valueMaps": [ - { - "op": "=", - "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, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "GB", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "80%", - "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 - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(container_memory_usage_bytes{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}) / 1024^3", - "intervalFactor": 2, - "refId": "A", - "step": 600 - } - ], - "thresholds": "", - "title": "Memory", - "type": "singlestat", - "valueFontSize": "110%", - "valueMaps": [ - { - "op": "=", - "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, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "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 - }, - "tableColumn": "", - "targets": [ - { - "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, - "refId": "A", - "step": 600 - } - ], - "thresholds": "", - "title": "Network", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "100px", - "panels": [ - { - "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}", - "decimals": null, - "editable": true, - "error": false, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": false - }, - "id": 5, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "max(kube_deployment_spec_replicas{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "metric": "kube_deployment_spec_replicas", - "refId": "A", - "step": 600 - } - ], - "thresholds": "", - "title": "Desired Replicas", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "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, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "min(kube_deployment_status_replicas_available{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "refId": "A", - "step": 600 - } - ], - "thresholds": "", - "title": "Available Replicas", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "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": 3, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "max(kube_deployment_status_observed_generation{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "", - "title": "Observed Generation", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "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": 2, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "max(kube_deployment_metadata_generation{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "", - "title": "Metadata Generation", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "350px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 1, - "legend": { - "avg": false, - "current": false, - "hideZero": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "max(kube_deployment_status_replicas{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "legendFormat": "current replicas", - "refId": "A", - "step": 30 - }, - { - "expr": "min(kube_deployment_status_replicas_available{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "legendFormat": "available", - "refId": "B", - "step": 30 - }, - { - "expr": "max(kube_deployment_status_replicas_unavailable{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "legendFormat": "unavailable", - "refId": "C", - "step": 30 - }, - { - "expr": "min(kube_deployment_status_replicas_updated{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "legendFormat": "updated", - "refId": "D", - "step": 30 - }, - { - "expr": "max(kube_deployment_spec_replicas{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", - "intervalFactor": 2, - "legendFormat": "desired", - "refId": "E", - "step": 30 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Replicas", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "transparent": false, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": ".*", - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": false, - "label": "Namespace", - "multi": false, - "name": "deployment_namespace", - "options": [], - "query": "label_values(kube_deployment_metadata_generation, namespace)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": null, - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": false, - "label": "Deployment", - "multi": false, - "name": "deployment_name", - "options": [], - "query": "label_values(kube_deployment_metadata_generation{namespace=\"$deployment_namespace\"}, deployment)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "deployment", - "type": "query", - "useTags": 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" - ] - }, - "timezone": "browser", - "title": "Deployment", - "version": 1 -} \ No newline at end of file diff --git a/assets/grafana/deployment.dashboard.py b/assets/grafana/deployment.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..4a2bda4674f9fbdcf6c52db01ca1b156d96a5aa8 --- /dev/null +++ b/assets/grafana/deployment.dashboard.py @@ -0,0 +1,467 @@ +import sys +import os.path +sys.path.insert(0, os.path.dirname(__file__)) +from _grafanalib import * + + +dashboard = Dashboard( + title='Deployment', + version=1, + graphTooltip=1, + time=Time(start='now-6h'), + templating=Templating(list=[ + { + 'allValue': '.*', + 'current': {}, + 'datasource': '${DS_PROMETHEUS}', + 'hide': 0, + 'includeAll': False, + 'label': 'Namespace', + 'multi': False, + 'name': 'deployment_namespace', + 'options': [], + 'query': 'label_values(kube_deployment_metadata_generation, ' + 'namespace)', + 'refresh': 1, + 'regex': '', + 'sort': 0, + 'tagValuesQuery': None, + 'tags': [], + 'tagsQuery': '', + 'type': 'query', + 'useTags': False, + }, + { + 'allValue': None, + 'current': {}, + 'datasource': '${DS_PROMETHEUS}', + 'hide': 0, + 'includeAll': False, + 'label': 'Deployment', + 'multi': False, + 'name': 'deployment_name', + 'options': [], + 'query': 'label_values(kube_deployment_metadata_generation' + '{namespace="$deployment_namespace"}, deployment)', + 'refresh': 1, + 'regex': '', + 'sort': 0, + 'tagValuesQuery': '', + 'tags': [], + 'tagsQuery': 'deployment', + 'type': 'query', + 'useTags': False, + }, + ]), + rows=[ + Row(panels=[ + SingleStat( + title='CPU', + id=8, + gauge=Gauge(show=False), + postfix='cores', + span=4, + valueFontSize='110%', + mappingType=1, + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + sparkline=SparkLine( + fillColor=(31, 118, 189, 0.18), + lineColor=(31, 120, 193), + show=True, + ), + targets=[ + { + 'expr': 'sum(rate(container_cpu_usage_seconds_total' + '{namespace=\"$deployment_namespace\",pod_name=~\"' + '$deployment_name.*\"}[3m]))', + }, + ], + ), + SingleStat( + title='Memory', + id=9, + postfix='GB', + prefixFontSize='80%', + gauge=Gauge(show=False), + span=4, + valueFontSize='110%', + mappingType=1, + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + sparkline=SparkLine( + fillColor=(31, 118, 189, 0.18), + lineColor=(31, 120, 193), + show=True, + ), + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + targets=[ + { + 'expr': 'sum(container_memory_usage_bytes{namespace=' + '\"$deployment_namespace\",pod_name=~\"$' + 'deployment_name.*\"}) / 1024^3', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 600, + }, + ], + ), + SingleStat( + title='Network', + format='Bps', + gauge=Gauge(thresholdMarkers=False), + id=7, + postfix='', + span=4, + mappingType=1, + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + sparkline=SparkLine( + fillColor=(31, 118, 189, 0.18), + lineColor=(31, 120, 193), + show=True, + ), + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + targets=[ + { + '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]))', + }, + ], + ), + ], + height=200, + ), + Row( + height=100, panels=[ + SingleStat( + title='Desired Replicas', + id=5, + mappingType=1, + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + span=3, + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + targets=[ + { + 'metric': 'kube_deployment_spec_replicas', + 'expr': 'max(kube_deployment_spec_replicas' + '{deployment="$deployment_name",namespace=' + '"$deployment_namespace"}) without ' + '(instance, pod)', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + gauge=Gauge(thresholdMarkers=False, show=False), + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + ), + SingleStat( + title='Available Replicas', + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + gauge=Gauge(show=False), + id=6, + mappingType=1, + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + targets=[ + { + 'expr': 'min(kube_deployment_status_replicas_' + 'available{deployment=\"$deployment_name\",' + 'namespace=\"$deployment_namespace\"}) without ' + '(instance, pod)', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + span=3, + sparkline=SparkLine(), + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + } + ], + ), + SingleStat( + title='Observed Generation', + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + gauge=Gauge(), + id=3, + mappingType=1, + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + targets=[ + { + 'expr': 'max(kube_deployment_status_observed_' + 'generation{deployment=\"$deployment_name\",' + 'namespace=\"$deployment_namespace\"}) without ' + '(instance, pod)', + }, + ], + rangeMaps=[ + { + 'from': "null", + 'text': 'N/A', + 'to': 'null', + }, + ], + span=3, + sparkline=SparkLine(), + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + } + ], + ), + SingleStat( + title='Metadata Generation', + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + gauge=Gauge(show=False), + id=2, + mappingType=1, + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + targets=[ + { + 'expr': 'max(kube_deployment_metadata_generation' + '{deployment=\"$deployment_name\",namespace=\"' + '$deployment_namespace\"}) without (instance, ' + 'pod)', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + span=3, + sparkline=SparkLine(), + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + ), + ], + ), + Row( + height=350, panels=[ + Graph( + title='Replicas', + dashLength=10, + dashes=False, + id=1, + spaceLength=10, + targets=[ + { + 'expr': 'max(kube_deployment_status_replicas' + '{deployment=\"$deployment_name\",namespace=\"' + '$deployment_namespace\"}) without (instance, ' + 'pod)', + 'legendFormat': 'current replicas', + 'refId': 'A', + 'step': 30, + }, + { + 'expr': 'min(kube_deployment_status_replicas_' + 'available{deployment=\"$deployment_name\",' + 'namespace=\"$deployment_namespace\"}) without ' + '(instance, pod)', + 'legendFormat': 'available', + 'refId': 'B', + 'step': 30, + }, + { + 'expr': 'max(kube_deployment_status_replicas_' + 'unavailable{deployment=\"$deployment_name\",' + 'namespace=\"$deployment_namespace\"}) without ' + '(instance, pod)', + 'legendFormat': 'unavailable', + 'refId': 'C', + 'step': 30, + }, + { + 'expr': 'min(kube_deployment_status_replicas_' + 'updated{deployment=\"$deployment_name\",' + 'namespace=\"$deployment_namespace\"}) without ' + '(instance, pod)', + 'legendFormat': 'updated', + 'refId': 'D', + 'step': 30, + }, + { + 'expr': 'max(kube_deployment_spec_replicas' + '{deployment=\"$deployment_name\",namespace=\"' + '$deployment_namespace\"}) without ' + '(instance, pod)', + 'legendFormat': 'desired', + 'refId': 'E', + 'step': 30, + } + ], + xAxis=XAxis(mode='time'), + yAxes=YAxes( + YAxis(min=None), + YAxis(format='short', min=None, show=False), + ), + ), + ] + ), + ], +) diff --git a/assets/grafana/kubernetes-capacity-planning-dashboard.json b/assets/grafana/kubernetes-capacity-planning-dashboard.json deleted file mode 100644 index 3ea159474ed9931311300946a24e4d15952b2fc0..0000000000000000000000000000000000000000 --- a/assets/grafana/kubernetes-capacity-planning-dashboard.json +++ /dev/null @@ -1,1048 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - } - ], - "annotations": { - "list": [] - }, - "description": "", - "editable": true, - "gnetId": 22, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [], - "refresh": false, - "rows": [ - { - "collapse": false, - "height": "250px", - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 3, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(node_cpu{mode=\"idle\"}[2m])) * 100", - "hide": false, - "intervalFactor": 10, - "legendFormat": "", - "refId": "A", - "step": 50 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Idle cpu", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percent", - "label": "cpu usage", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 9, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(node_load1)", - "intervalFactor": 4, - "legendFormat": "load 1m", - "refId": "A", - "step": 20, - "target": "" - }, - { - "expr": "sum(node_load5)", - "intervalFactor": 4, - "legendFormat": "load 5m", - "refId": "B", - "step": 20, - "target": "" - }, - { - "expr": "sum(node_load15)", - "intervalFactor": 4, - "legendFormat": "load 15m", - "refId": "C", - "step": 20, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "System load", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "250px", - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 4, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "node_memory_SwapFree{instance=\"172.17.0.1:9100\",job=\"prometheus\"}", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 9, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(node_memory_MemTotal) - sum(node_memory_MemFree) - sum(node_memory_Buffers) - sum(node_memory_Cached)", - "intervalFactor": 2, - "legendFormat": "memory usage", - "metric": "memo", - "refId": "A", - "step": 10, - "target": "" - }, - { - "expr": "sum(node_memory_Buffers)", - "interval": "", - "intervalFactor": 2, - "legendFormat": "memory buffers", - "metric": "memo", - "refId": "B", - "step": 10, - "target": "" - }, - { - "expr": "sum(node_memory_Cached)", - "interval": "", - "intervalFactor": 2, - "legendFormat": "memory cached", - "metric": "memo", - "refId": "C", - "step": 10, - "target": "" - }, - { - "expr": "sum(node_memory_MemFree)", - "interval": "", - "intervalFactor": 2, - "legendFormat": "memory free", - "metric": "memo", - "refId": "D", - "step": 10, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Memory usage", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 5, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "((sum(node_memory_MemTotal) - sum(node_memory_MemFree) - sum(node_memory_Buffers) - sum(node_memory_Cached)) / sum(node_memory_MemTotal)) * 100", - "intervalFactor": 2, - "metric": "", - "refId": "A", - "step": 60, - "target": "" - } - ], - "thresholds": "80, 90", - "title": "Memory usage", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": 246, - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "read", - "yaxis": 1 - }, - { - "alias": "{instance=\"172.17.0.1:9100\"}", - "yaxis": 2 - }, - { - "alias": "io time", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 9, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(node_disk_bytes_read[5m]))", - "hide": false, - "intervalFactor": 4, - "legendFormat": "read", - "refId": "A", - "step": 20, - "target": "" - }, - { - "expr": "sum(rate(node_disk_bytes_written[5m]))", - "intervalFactor": 4, - "legendFormat": "written", - "refId": "B", - "step": 20 - }, - { - "expr": "sum(rate(node_disk_io_time_ms[5m]))", - "intervalFactor": 4, - "legendFormat": "io time", - "refId": "C", - "step": 20 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Disk I/O", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "ms", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 12, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(node_filesystem_size{device!=\"rootfs\"}) - sum(node_filesystem_free{device!=\"rootfs\"})) / sum(node_filesystem_size{device!=\"rootfs\"})", - "intervalFactor": 2, - "refId": "A", - "step": 60, - "target": "" - } - ], - "thresholds": "0.75, 0.9", - "title": "Disk space usage", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "250px", - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "transmitted ", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(node_network_receive_bytes{device!~\"lo\"}[5m]))", - "hide": false, - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 10, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network received", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 10, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "transmitted ", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(node_network_transmit_bytes{device!~\"lo\"}[5m]))", - "hide": false, - "intervalFactor": 2, - "legendFormat": "", - "refId": "B", - "step": 10, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network transmitted", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": 276, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "fill": 1, - "id": 11, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 9, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(kube_pod_info)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Current number of Pods", - "refId": "A", - "step": 10 - }, - { - "expr": "sum(kube_node_status_capacity_pods)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Maximum capacity of pods", - "refId": "B", - "step": 10 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Cluster Pod Utilization", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 7, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "100 - (sum(kube_node_status_capacity_pods) - sum(kube_pod_info)) / sum(kube_node_status_capacity_pods) * 100", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 60, - "target": "" - } - ], - "thresholds": "80,90", - "title": "Pod Utilization", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Dashboard Row", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "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": "browser", - "title": "Kubernetes Capacity Planning", - "version": 4 -} \ No newline at end of file diff --git a/assets/grafana/kubernetes-capacity-planning.dashboard.py b/assets/grafana/kubernetes-capacity-planning.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..bf8762bdcbcaf610bd286cc91fcaa2ccd7f54911 --- /dev/null +++ b/assets/grafana/kubernetes-capacity-planning.dashboard.py @@ -0,0 +1,454 @@ +from grafanalib.core import * + + +dashboard = Dashboard( + title='Kubernetes Capacity Planning', + version=4, + gnetId=22, + graphTooltip=0, + refresh=False, + schemaVersion=14, + time=Time(start='now-1h'), + timezone='browser', + inputs=[ + { + 'name': 'DS_PROMETHEUS', + 'label': 'prometheus', + 'description': '', + 'type': 'datasource', + 'pluginId': 'prometheus', + 'pluginName': 'Prometheus', + } + ], + rows=[ + Row( + height=250, title='New Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Idle CPU', + id=3, + dataSource='${DS_PROMETHEUS}', + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=6, + tooltip=Tooltip(msResolution=False), + yAxes=YAxes( + YAxis(format='percent', label='cpu usage',), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum(rate(node_cpu{mode=\"idle\"}[2m])) ' + '* 100', + 'hide': False, + 'intervalFactor': 10, + 'legendFormat': '', + 'refId': 'A', + 'step': 50, + }, + ], + ), + Graph( + title='System Load', + id=9, + dataSource='${DS_PROMETHEUS}', + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=6, + tooltip=Tooltip(msResolution=False), + yAxes=YAxes( + YAxis(format='percentunit', min=None), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum(node_load1)', + 'intervalFactor': 4, + 'legendFormat': 'load 1m', + 'refId': 'A', + 'step': 20, + 'target': '', + }, + { + 'expr': 'sum(node_load5)', + 'intervalFactor': 4, + 'legendFormat': 'load 5m', + 'refId': 'B', + 'step': 20, + 'target': '' + }, + { + 'expr': 'sum(node_load15)', + 'intervalFactor': 4, + 'legendFormat': 'load 15m', + 'refId': 'C', + 'step': 20, + 'target': '', + }, + ], + ), + ], + ), + Row( + height=250, title='New Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Memory Usage', + id=4, + dataSource='${DS_PROMETHEUS}', + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=9, + stack=True, + seriesOverrides=[ + { + 'alias': 'node_memory_SwapFree{instance=' + '\"172.17.0.1:9100\",job=\"prometheus\"}', + 'yaxis': 2, + } + ], + tooltip=Tooltip( + msResolution=False, valueType='individual' + ), + yAxes=YAxes( + YAxis(format='bytes', min='0'), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum(node_memory_MemTotal) - sum(node_' + 'memory_MemFree) - sum(node_memory_Buffers) - ' + 'sum(node_memory_Cached)', + 'intervalFactor': 2, + 'legendFormat': 'memory usage', + 'metric': 'memo', + 'refId': 'A', + 'step': 10, + 'target': '', + }, + { + 'expr': 'sum(node_memory_Buffers)', + 'interval': '', + 'intervalFactor': 2, + 'legendFormat': 'memory buffers', + 'metric': 'memo', + 'refId': 'B', + 'step': 10, + 'target': '', + }, + { + 'expr': 'sum(node_memory_Cached)', + 'interval': '', + 'intervalFactor': 2, + 'legendFormat': 'memory cached', + 'metric': 'memo', + 'refId': 'C', + 'step': 10, + 'target': '', + }, + { + 'expr': 'sum(node_memory_MemFree)', + 'interval': '', + 'intervalFactor': 2, + 'legendFormat': 'memory free', + 'metric': 'memo', + 'refId': 'D', + 'step': 10, + 'target': '', + }, + ], + ), + SingleStat( + title='Memory Usage', + dataSource='${DS_PROMETHEUS}', + id=5, + format='percent', + span=3, + gauge=Gauge(show=True), + thresholds='80, 90', + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + targets=[ + { + 'expr': '((sum(node_memory_MemTotal) - ' + 'sum(node_memory_MemFree) - sum(' + 'node_memory_Buffers) - sum(node_memory_Cached)) ' + '/ sum(node_memory_MemTotal)) * 100', + 'intervalFactor': 2, + 'metric': '', + 'refId': 'A', + 'step': 60, + 'target': '', + }, + ], + ), + ], + ), + Row( + height=246, title='New Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Disk I/O', + dataSource='${DS_PROMETHEUS}', + id=6, + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=9, + tooltip=Tooltip(msResolution=False), + seriesOverrides=[ + { + 'alias': 'read', + 'yaxis': 1 + }, + { + 'alias': '{instance=\"172.17.0.1:9100\"}', + 'yaxis': 2, + }, + { + 'alias': 'io time', + 'yaxis': 2, + }, + ], + yAxes=YAxes( + YAxis(format='bytes', min=None), + YAxis(format='ms', min=None), + ), + targets=[ + { + 'expr': 'sum(rate(node_disk_bytes_read[5m]))', + 'hide': False, + 'intervalFactor': 4, + 'legendFormat': 'read', + 'refId': 'A', + 'step': 20, + 'target': '' + }, + { + 'expr': 'sum(rate(node_disk_bytes_written[5m]))', + 'intervalFactor': 4, + 'legendFormat': 'written', + 'refId': 'B', + 'step': 20 + }, + { + 'expr': 'sum(rate(node_disk_io_time_ms[5m]))', + 'intervalFactor': 4, + 'legendFormat': 'io time', + 'refId': 'C', + 'step': 20 + }, + ], + ), + SingleStat( + title='Disk Space Usage', + dataSource='${DS_PROMETHEUS}', + id=12, + span=3, + format='percentunit', + valueName='current', + gauge=Gauge( + maxValue=1, + show=True, + ), + thresholds='0.75, 0.9', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + targets=[ + { + 'expr': '(sum(node_filesystem_size{device!=' + '\"rootfs\"}) - sum(node_filesystem_free{' + 'device!=\"rootfs\"})) / sum(node_filesystem_size' + '{device!=\"rootfs\"})', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 60, + 'target': '', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + ), + ] + ), + Row( + height=250, title='New Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Network Received', + dataSource='${DS_PROMETHEUS}', + id=8, + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=6, + tooltip=Tooltip(msResolution=False), + seriesOverrides=[ + { + 'alias': 'transmitted', + 'yaxis': 2, + }, + ], + yAxes=YAxes( + YAxis(format='bytes', min=None), + YAxis(format='bytes', min=None), + ), + targets=[ + { + 'expr': 'sum(rate(node_network_receive_bytes' + '{device!~\"lo\"}[5m]))', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 10, + 'target': '', + }, + ], + ), + Graph( + title='Network Transmitted', + dataSource='${DS_PROMETHEUS}', + id=10, + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=6, + tooltip=Tooltip(msResolution=False), + seriesOverrides=[ + { + 'alias': 'transmitted', + 'yaxis': 2, + }, + ], + yAxes=YAxes( + YAxis(format='bytes', min=None), + YAxis(format='bytes', min=None), + ), + targets=[ + { + 'expr': 'sum(rate(node_network_transmit_bytes' + '{device!~\"lo\"}[5m]))', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'B', + 'step': 10, + 'target': '', + }, + ], + ), + ], + ), + Row( + height=276, title='New Row', showTitle=False, + titleSize='h6', + panels=[ + Graph( + title='Cluster Pod Utilization', + dataSource='${DS_PROMETHEUS}', + id=11, + span=9, + dashes=False, + spaceLength=11, + tooltip=Tooltip( + msResolution=False, + valueType='individual', + ), + yAxes=YAxes( + YAxis(format='short', min=None), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum(kube_pod_info)', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': 'Current number of Pods', + 'refId': 'A', + 'step': 10, + }, + { + 'expr': 'sum(kube_node_status_capacity_pods)', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': 'Maximum capacity of pods', + 'refId': 'B', + 'step': 10, + } + ], + ), + SingleStat( + title='Pod Utilization', + dataSource='${DS_PROMETHEUS}', + id=7, + span=3, + format='percent', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + gauge=Gauge( + show=True, + ), + thresholds='80, 90', + valueName='current', + targets=[ + { + 'expr': '100 - (sum(kube_node_status_capacity_' + 'pods) - sum(kube_pod_info)) / sum(kube_node_' + 'status_capacity_pods) * 100', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 60, + 'target': '', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + ), + ] + ), + ], +) diff --git a/assets/grafana/kubernetes-cluster-health-dashboard.json b/assets/grafana/kubernetes-cluster-health-dashboard.json deleted file mode 100644 index 46eb6ca7be550861a816af7a9c85c70159ef3e6c..0000000000000000000000000000000000000000 --- a/assets/grafana/kubernetes-cluster-health-dashboard.json +++ /dev/null @@ -1,733 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - } - ], - "annotations": { - "list": [] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [], - "rows": [ - { - "collapse": false, - "height": 254, - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 1, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(up{job=~\"apiserver|kube-scheduler|kube-controller-manager\"} == 0)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Control Plane Components Down", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "Everything UP and healthy", - "value": "null" - }, - { - "op": "=", - "text": "", - "value": "" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 2, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(ALERTS{alertstate=\"firing\",alertname!=\"DeadMansSwitch\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "3,5", - "title": "Alerts Firing", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 3, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(ALERTS{alertstate=\"pending\",alertname!=\"DeadMansSwitch\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "3,5", - "title": "Alerts Pending", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 4, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(increase(kube_pod_container_status_restarts[1h]) > 5)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Crashlooping Pods", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Dashboard Row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": 250, - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 5, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(kube_node_status_condition{condition=\"Ready\",status!=\"true\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Node Not Ready", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 6, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(kube_node_status_condition{condition=\"DiskPressure\",status=\"true\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Node Disk Pressure", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 7, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(kube_node_status_condition{condition=\"MemoryPressure\",status=\"true\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Node Memory Pressure", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 8, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(kube_node_spec_unschedulable)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Nodes Unschedulable", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Dashboard Row", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "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": "Kubernetes Cluster Health", - "version": 9 -} \ No newline at end of file diff --git a/assets/grafana/kubernetes-cluster-health.dashboard.py b/assets/grafana/kubernetes-cluster-health.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..e7296f6790164a8b01d6dee9a25e37cb6e03e3e7 --- /dev/null +++ b/assets/grafana/kubernetes-cluster-health.dashboard.py @@ -0,0 +1,396 @@ +from grafanalib.core import * + + +dashboard = Dashboard( + title='Kubernetes Cluster Health', + version=9, + graphTooltip=0, + schemaVersion=14, + time=Time(start='now-6h'), + timezone='browser', + inputs=[ + { + 'name': 'DS_PROMETHEUS', + 'label': 'prometheus', + 'description': '', + 'type': 'datasource', + 'pluginId': 'prometheus', + 'pluginName': 'Prometheus' + }, + ], + rows=[ + Row( + height=254, title='Row', showTitle=False, + titleSize='h6', panels=[ + SingleStat( + title='Control Plane Components Down', + id=1, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + span=3, + thresholds='1, 3', + colorValue=True, + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'Everything UP and healthy', + 'value': 'null', + }, + { + 'op': '=', + 'text': '', + 'value': '', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'sum(up{job=~"apiserver|kube-scheduler|' + 'kube-controller-manager"} == 0)', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + SingleStat( + title='Alerts Firing', + id=2, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + colorValue=True, + span=3, + valueName='current', + thresholds='1, 3', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': '0', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'sum(ALERTS{alertstate="firing",' + 'alertname!="DeadMansSwitch"})', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + SingleStat( + title='Alerts Pending', + id=3, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + colorValue=True, + span=3, + valueName='current', + thresholds='3, 5', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': '0', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'sum(ALERTS{alertstate="pending",' + 'alertname!="DeadMansSwitch"})', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + SingleStat( + title='Crashlooping Pods', + id=4, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + colorValue=True, + span=3, + valueName='current', + thresholds='1, 3', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': '0', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'count(increase(kube_pod_container_' + 'status_restarts[1h]) > 5)', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + ], + ), + Row( + height=250, title='Row', showTitle=False, + titleSize='h6', panels=[ + SingleStat( + title='Node Not Ready', + id=5, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + colorValue=True, + span=3, + valueName='current', + thresholds='1, 3', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'sum(kube_node_status_condition{' + 'condition="Ready",status!="true"})', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + SingleStat( + title='Node Disk Pressure', + id=6, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + colorValue=True, + span=3, + valueName='current', + thresholds='1, 3', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'sum(kube_node_status_condition' + '{condition="DiskPressure",status="true"})', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + SingleStat( + title='Node Memory Pressure', + id=7, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + colorValue=True, + span=3, + valueName='current', + thresholds='1, 3', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'sum(kube_node_status_condition' + '{condition="MemoryPressure",status="true"})', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + SingleStat( + title='Nodes Unschedulable', + id=8, + dataSource='${DS_PROMETHEUS}', + gauge=Gauge(), + colorValue=True, + span=3, + valueName='current', + thresholds='1, 3', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'sum(kube_node_spec_unschedulable)', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ], + ), + ], + ), + ], +) diff --git a/assets/grafana/kubernetes-cluster-status-dashboard.json b/assets/grafana/kubernetes-cluster-status-dashboard.json deleted file mode 100644 index d30906bdaf53dd232bcdeada977412c76ed7ecec..0000000000000000000000000000000000000000 --- a/assets/grafana/kubernetes-cluster-status-dashboard.json +++ /dev/null @@ -1,896 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - } - ], - "annotations": { - "list": [] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [], - "rows": [ - { - "collapse": false, - "height": 129, - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 5, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 6, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(up{job=~\"apiserver|kube-scheduler|kube-controller-manager\"} == 0)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Control Plane UP", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "UP", - "value": "null" - } - ], - "valueName": "total" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 6, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 6, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(ALERTS{alertstate=\"firing\",alertname!=\"DeadMansSwitch\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "3,5", - "title": "Alerts Firing", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": true, - "title": "Cluster Health", - "titleSize": "h6" - }, - { - "collapse": false, - "height": 168, - "panels": [ - { - "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}", - "decimals": null, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 1, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(up{job=\"apiserver\"} == 1) / count(up{job=\"apiserver\"})) * 100", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "50,80", - "title": "API Servers UP", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "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}", - "decimals": null, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 2, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(up{job=\"kube-controller-manager\"} == 1) / count(up{job=\"kube-controller-manager\"})) * 100", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "50,80", - "title": "Controller Managers UP", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "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}", - "decimals": null, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 3, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(up{job=\"kube-scheduler\"} == 1) / count(up{job=\"kube-scheduler\"})) * 100", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "50,80", - "title": "Schedulers UP", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "hideTimeOverride": false, - "id": 4, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "count(increase(kube_pod_container_status_restarts{namespace=~\"kube-system|tectonic-system\"}[1h]) > 5)", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "1,3", - "title": "Crashlooping Control Plane Pods", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "current" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": true, - "title": "Control Plane Status", - "titleSize": "h6" - }, - { - "collapse": false, - "height": 158, - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 8, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(100 - (avg by (instance) (rate(node_cpu{job=\"node-exporter\",mode=\"idle\"}[5m])) * 100)) / count(node_cpu{job=\"node-exporter\",mode=\"idle\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "80,90", - "title": "CPU Utilization", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 7, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "((sum(node_memory_MemTotal) - sum(node_memory_MemFree) - sum(node_memory_Buffers) - sum(node_memory_Cached)) / sum(node_memory_MemTotal)) * 100", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "80,90", - "title": "Memory Utilization", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 9, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(node_filesystem_size{device!=\"rootfs\"}) - sum(node_filesystem_free{device!=\"rootfs\"})) / sum(node_filesystem_size{device!=\"rootfs\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "80,90", - "title": "Filesystem Utilization", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 10, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "100 - (sum(kube_node_status_capacity_pods) - sum(kube_pod_info)) / sum(kube_node_status_capacity_pods) * 100", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "80,90", - "title": "Pod Utilization", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": true, - "title": "Capacity Planing", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "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": "Kubernetes Cluster Status", - "version": 3 -} \ No newline at end of file diff --git a/assets/grafana/kubernetes-cluster-status.dashboard.py b/assets/grafana/kubernetes-cluster-status.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..7288c52214e51c58c59fa6908af03fbcbdfded4c --- /dev/null +++ b/assets/grafana/kubernetes-cluster-status.dashboard.py @@ -0,0 +1,450 @@ +import sys +import os.path +sys.path.insert(0, os.path.dirname(__file__)) +from _grafanalib import * + + +dashboard = Dashboard( + title='Kubernetes Cluster Status', + version=3, + time=Time(start='now-6h'), + rows=[ + Row( + height=129, title='Cluster Health', showTitle=True, + panels=[ + SingleStat( + title='Control Plane UP', + id=5, + gauge=Gauge(show=False), + colorValue=True, + mappingType=1, + thresholds='1, 3', + valueName='total', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'UP', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + targets=[ + { + 'expr': 'sum(up{job=~"apiserver|kube-scheduler|' + 'kube-controller-manager"} == 0)', + 'format': 'time_series', + }, + ] + ), + SingleStat( + title='Alerts Firing', + id=6, + gauge=Gauge(show=False), + colorValue=True, + mappingType=1, + thresholds='3, 5', + valueName='current', + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': '0', + 'value': 'null', + }, + ], + targets=[ + { + 'expr': 'sum(ALERTS{alertstate="firing",' + 'alertname!="DeadMansSwitch"})', + 'format': 'time_series', + }, + ] + ), + ], + ), + Row( + height=168, title='Control Plane Status', showTitle=True, + panels=[ + SingleStat( + title='API Servers UP', + id=1, + mappingType=1, + format='percent', + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + thresholds='50, 80', + span=3, + valueName='current', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + targets=[ + { + 'expr': '(sum(up{job="apiserver"} == 1) / ' + 'count(up{job="apiserver"})) * 100', + 'format': 'time_series', + }, + ] + ), + SingleStat( + title='Controller Managers UP', + id=2, + span=3, + mappingType=1, + thresholds='50, 80', + format='percent', + valueName='current', + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + targets=[ + { + 'expr': '(sum(up{job="kube-controller-manager"} ==' + ' 1) / count(up{job="kube-controller-manager"})) ' + '* 100', + 'format': 'time_series', + }, + ] + ), + SingleStat( + title='Schedulers UP', + id=3, + span=3, + mappingType=1, + format='percent', + thresholds='50, 80', + valueName='current', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + targets=[ + { + 'expr': '(sum(up{job="kube-scheduler"} == 1) / ' + 'count(up{job="kube-scheduler"})) * 100', + 'format': 'time_series', + }, + ] + ), + SingleStat( + title='Crashlooping Control Plane Pods', + id=4, + colorValue=True, + gauge=Gauge(show=False), + span=3, + mappingType=1, + thresholds='1, 3', + valueName='current', + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': '0', + 'value': 'null', + }, + ], + targets=[ + { + 'expr': 'count(increase(kube_pod_container_' + 'status_restarts{namespace=~"kube-system|' + 'tectonic-system"}[1h]) > 5)', + 'format': 'time_series', + }, + ] + ), + ], + ), + Row( + height=158, title='Capacity Planning', showTitle=True, + panels=[ + SingleStat( + title='CPU Utilization', + id=8, + format='percent', + mappingType=1, + span=3, + thresholds='80, 90', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + targets=[ + { + 'expr': 'sum(100 - (avg by (instance) (rate(' + 'node_cpu{job="node-exporter",mode="idle"}[5m])) ' + '* 100)) / count(node_cpu{job="node-exporter",' + 'mode="idle"})', + 'format': 'time_series', + }, + ] + ), + SingleStat( + title='Memory Utilization', + id=7, + format='percent', + span=3, + mappingType=1, + thresholds='80, 90', + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + targets=[ + { + 'expr': '((sum(node_memory_MemTotal) - sum(' + 'node_memory_MemFree) - sum(node_memory_Buffers) ' + '- sum(node_memory_Cached)) / sum(' + 'node_memory_MemTotal)) * 100', + 'format': 'time_series', + }, + ] + ), + SingleStat( + title='Filesystem Utilization', + id=9, + span=3, + format='percent', + mappingType=1, + thresholds='80, 90', + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + targets=[ + { + 'expr': '(sum(node_filesystem_size{device!=' + '"rootfs"}) - sum(node_filesystem_free{device!=' + '"rootfs"})) / sum(node_filesystem_size{device!=' + '"rootfs"})', + 'format': 'time_series', + }, + ] + ), + SingleStat( + title='Pod Utilization', + id=10, + gauge=Gauge(show=True), + span=3, + mappingType=1, + format='percent', + thresholds='80, 90', + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + targets=[ + { + 'expr': '100 - (sum(kube_node_status_capacity_pods' + ') - sum(kube_pod_info)) / sum(kube_node_status_' + 'capacity_pods) * 100', + 'format': 'time_series', + }, + ] + ), + ], + ), + ], +) diff --git a/assets/grafana/kubernetes-control-plane-status-dashboard.json b/assets/grafana/kubernetes-control-plane-status-dashboard.json deleted file mode 100644 index 47721922ac45a3167f1c0eec43987d4140c31bab..0000000000000000000000000000000000000000 --- a/assets/grafana/kubernetes-control-plane-status-dashboard.json +++ /dev/null @@ -1,663 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - } - ], - "annotations": { - "list": [] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [], - "rows": [ - { - "collapse": false, - "height": "250px", - "panels": [ - { - "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}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 1, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(up{job=\"apiserver\"} == 1) / sum(up{job=\"apiserver\"})) * 100", - "format": "time_series", - "intervalFactor": 2, - "refId": "A", - "step": 600 - } - ], - "thresholds": "50,80", - "title": "API Servers UP", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "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}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 2, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(up{job=\"kube-controller-manager\"} == 1) / sum(up{job=\"kube-controller-manager\"})) * 100", - "format": "time_series", - "intervalFactor": 2, - "refId": "A", - "step": 600 - } - ], - "thresholds": "50,80", - "title": "Controller Mangers UP", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "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}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 3, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(up{job=\"kube-scheduler\"} == 1) / sum(up{job=\"kube-scheduler\"})) * 100", - "format": "time_series", - "intervalFactor": 2, - "refId": "A", - "step": 600 - } - ], - "thresholds": "50,80", - "title": "Schedulers UP", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 4, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "max(sum by(instance) (rate(apiserver_request_count{code=~\"5..\"}[5m])) / sum by(instance) (rate(apiserver_request_count[5m]))) * 100", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 600 - } - ], - "thresholds": "5,10", - "title": "API Server Request Error Rate", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "0", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Dashboard Row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": 250, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "fill": 1, - "id": 7, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by(verb) (rate(apiserver_latency_seconds:quantile[5m]) >= 0)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 30 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "API Server Request Latency", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Dashboard Row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": 250, - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "fill": 1, - "id": 5, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "cluster:scheduler_e2e_scheduling_latency_seconds:quantile", - "format": "time_series", - "intervalFactor": 2, - "refId": "A", - "step": 60 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "End to end scheduling latency", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "dtdurations", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "fill": 1, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by(instance) (rate(apiserver_request_count{code!~\"2..\"}[5m]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Error Rate", - "refId": "A", - "step": 60 - }, - { - "expr": "sum by(instance) (rate(apiserver_request_count[5m]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Request Rate", - "refId": "B", - "step": 60 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "API Server Request Rates", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Dashboard Row", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "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": "Kubernetes Control Plane Status", - "version": 3 -} \ No newline at end of file diff --git a/assets/grafana/kubernetes-control-plane-status.dashboard.py b/assets/grafana/kubernetes-control-plane-status.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..b90206755beff75614211845eea766102e501a4e --- /dev/null +++ b/assets/grafana/kubernetes-control-plane-status.dashboard.py @@ -0,0 +1,336 @@ +from grafanalib.core import * + +dashboard = Dashboard( + title='Kubernetes Control Plane Status', + version=3, + graphTooltip=0, + schemaVersion=14, + time=Time(start='now-6h'), + timezone='browser', + refresh=None, + inputs=[ + { + 'name': 'DS_PROMETHEUS', + 'label': 'prometheus', + 'description': '', + 'type': 'datasource', + 'pluginId': 'prometheus', + 'pluginName': 'Prometheus' + }, + ], + rows=[ + Row( + title='Dashboard Row', showTitle=False, titleSize='h6', + panels=[ + SingleStat( + title='API Servers UP', + dataSource='${DS_PROMETHEUS}', + format='percent', + gauge=Gauge( + show=True, + ), + id=1, + span=3, + thresholds='50, 80', + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + } + ], + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + targets=[ + { + 'expr': '(sum(up{job=\"apiserver\"} == 1) / ' + 'sum(up{job=\"apiserver\"})) * 100', + 'format': 'time_series', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 600, + }, + ] + ), + SingleStat( + title='Controller Managers UP', + dataSource='${DS_PROMETHEUS}', + format='percent', + gauge=Gauge( + show=True, + ), + id=2, + span=3, + thresholds='50, 80', + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + } + ], + rangeMaps=([ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ]), + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + targets=[ + { + 'expr': '(sum(up{job=\"kube-controller-manager\"}' + ' == 1) / sum(up{job=\"kube-controller-manager\"' + '})) * 100', + 'format': 'time_series', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 600, + } + ] + ), + SingleStat( + title='Schedulers UP', + dataSource='${DS_PROMETHEUS}', + format='percent', + gauge=Gauge( + show=True, + ), + id=3, + span=3, + thresholds='50, 80', + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + } + ], + rangeMaps=([ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ]), + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + colors=[ + (245, 54, 54, 0.9), + (237, 129, 40, 0.89), + (50, 172, 45, 0.97), + ], + targets=[ + { + 'expr': '(sum(up{job=\"kube-scheduler\"} == 1) ' + '/ sum(up{job=\"kube-scheduler\"})) * 100', + 'format': 'time_series', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 600, + } + ] + ), + SingleStat( + title='API Server Request Error Rate', + dataSource='${DS_PROMETHEUS}', + format='percent', + gauge=Gauge( + show=True, + ), + id=4, + span=3, + thresholds='5, 10', + valueMaps=[ + { + 'op': '=', + 'text': '0', + 'value': 'null', + } + ], + rangeMaps=([ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ]), + mappingTypes=[ + { + 'name': 'value to text', + 'value': 1, + }, + { + 'name': 'range to text', + 'value': 2, + } + ], + targets=[ + { + 'expr': 'max(sum by(instance) (rate(' + 'apiserver_request_count{code=~"5.."}[5m])) / ' + 'sum by(instance) (rate(apiserver_request_count' + '[5m]))) * 100', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 600, + }, + ] + ), + ], + ), + Row( + title='Dashboard Row', showTitle=False, titleSize='h6', + panels=[ + Graph( + title='API Server Request Latency', + id=7, + dataSource='${DS_PROMETHEUS}', + dashLength=10, + dashes=False, + isNew=False, + lineWidth=1, + nullPointMode='null', + tooltip=Tooltip( + msResolution=False, valueType='individual', + ), + spaceLength=10, + yAxes=YAxes( + YAxis(format='short', min=None), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum by(verb) (rate(apiserver_latency_' + 'seconds:quantile[5m]) >= 0)', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 30, + } + ], + ), + ], + ), + Row( + title='Dashboard Row', showTitle=False, titleSize='h6', + panels=[ + Graph( + title='End to End Scheduling Latency', + id=5, + dataSource='${DS_PROMETHEUS}', + isNew=False, + dashLength=10, + lineWidth=1, + nullPointMode="null", + spaceLength=10, + span=6, + dashes=False, + tooltip=Tooltip( + msResolution=False, + valueType='individual', + ), + yAxes=YAxes( + YAxis(format='short', min=None), + YAxis(format='dtdurations', min=None), + ), + targets=[ + { + 'expr': 'cluster:scheduler_e2e_scheduling_' + 'latency_seconds:quantile', + 'format': 'time_series', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 60, + } + ], + ), + Graph( + title='API Server Request Rates', + id=6, + dataSource='${DS_PROMETHEUS}', + isNew=False, + dashLength=10, + lineWidth=1, + nullPointMode="null", + spaceLength=10, + span=6, + dashes=False, + tooltip=Tooltip( + msResolution=False, + valueType='individual', + ), + yAxes=YAxes( + YAxis(format='short', min=None), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum by(instance) (rate(apiserver_' + 'request_count{code!~\"2..\"}[5m]))', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': 'Error Rate', + 'refId': 'A', + 'step': 60, + }, + { + 'expr': 'sum by(instance) (rate(apiserver_' + 'request_count[5m]))', + 'format': 'time_series', + 'intervalFactor': 2, + 'legendFormat': 'Request Rate', + 'refId': 'B', + 'step': 60, + }, + ], + ), + ], + ), + ], +) diff --git a/assets/grafana/kubernetes-resource-requests-dashboard.json b/assets/grafana/kubernetes-resource-requests-dashboard.json deleted file mode 100644 index fe52cba7070536a45417ddf8feaf780f94686989..0000000000000000000000000000000000000000 --- a/assets/grafana/kubernetes-resource-requests-dashboard.json +++ /dev/null @@ -1,434 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - } - ], - "annotations": { - "list": [] - }, - "description": "", - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [], - "rows": [ - { - "collapse": false, - "height": "300", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "description": "This represents the total [CPU resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu) in the cluster.\nFor comparison the total [allocatable CPU cores](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node-allocatable.md) is also shown.", - "fill": 1, - "id": 1, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 9, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "min(sum(kube_node_status_allocatable_cpu_cores) by (instance))", - "hide": false, - "intervalFactor": 2, - "legendFormat": "Allocatable CPU Cores", - "refId": "A", - "step": 20 - }, - { - "expr": "max(sum(kube_pod_container_resource_requests_cpu_cores) by (instance))", - "intervalFactor": 2, - "legendFormat": "Requested CPU Cores", - "refId": "B", - "step": 20 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "CPU Cores", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "CPU Cores", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 2, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "expr": "max(sum(kube_pod_container_resource_requests_cpu_cores) by (instance)) / min(sum(kube_node_status_allocatable_cpu_cores) by (instance)) * 100", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 240 - } - ], - "thresholds": "80, 90", - "title": "CPU Cores", - "type": "singlestat", - "valueFontSize": "110%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "CPU Cores", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "300", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "description": "This represents the total [memory resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory) in the cluster.\nFor comparison the total [allocatable memory](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node-allocatable.md) is also shown.", - "fill": 1, - "id": 3, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 9, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "min(sum(kube_node_status_allocatable_memory_bytes) by (instance))", - "hide": false, - "intervalFactor": 2, - "legendFormat": "Allocatable Memory", - "refId": "A", - "step": 20 - }, - { - "expr": "max(sum(kube_pod_container_resource_requests_memory_bytes) by (instance))", - "intervalFactor": 2, - "legendFormat": "Requested Memory", - "refId": "B", - "step": 20 - } - ], - "thresholds": [], - "timeFrom": null, - "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": [ - { - "format": "bytes", - "label": "Memory", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "decimals": null, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 4, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "expr": "max(sum(kube_pod_container_resource_requests_memory_bytes) by (instance)) / min(sum(kube_node_status_allocatable_memory_bytes) by (instance)) * 100", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 240 - } - ], - "thresholds": "80, 90", - "title": "Memory", - "type": "singlestat", - "valueFontSize": "110%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Memory", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-3h", - "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": "browser", - "title": "Kubernetes Resource Requests", - "version": 2 -} \ No newline at end of file diff --git a/assets/grafana/kubernetes-resource-requests.dashboard.py b/assets/grafana/kubernetes-resource-requests.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..3b3b61579d96d2fe690aab5f2c43d11a932254fd --- /dev/null +++ b/assets/grafana/kubernetes-resource-requests.dashboard.py @@ -0,0 +1,200 @@ +from grafanalib.core import * + + +dashboard = Dashboard( + title='Kubernetes Resource Requests', + version=2, + graphTooltip=0, + refresh=False, + schemaVersion=14, + time=Time(start='now-3h'), + timezone='browser', + inputs=[ + { + 'name': 'DS_PROMETHEUS', + 'label': 'prometheus', + 'description': '', + 'type': 'datasource', + 'pluginId': 'prometheus', + 'pluginName': 'Prometheus' + }, + ], + rows=[ + Row( + height=300, title='CPU Cores', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='CPU Cores', + description='This represents the total [CPU resource ' + 'requests](https://kubernetes.io/docs/concepts/configu' + 'ration/manage-compute-resources-container/#meaning-of-' + 'cpu) in the cluster.\nFor comparison the total ' + '[allocatable CPU cores](https://github.com/kubernetes/' + 'community/blob/master/contributors/design-proposals/' + 'node-allocatable.md) is also shown.', + id=1, + dataSource='${DS_PROMETHEUS}', + dashLength=10, + dashes=False, + isNew=False, + lineWidth=1, + spaceLength=10, + nullPointMode='null', + span=9, + tooltip=Tooltip( + msResolution=False, valueType='individual' + ), + yAxes=YAxes( + YAxis(format='short', label='CPU Cores', min=None,), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'min(sum(kube_node_status_allocatable_' + 'cpu_cores) by (instance))', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': 'Allocatable CPU Cores', + 'refId': 'A', + 'step': 20, + }, + { + 'expr': 'max(sum(kube_pod_container_resource_' + 'requests_cpu_cores) by (instance))', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': 'Requested CPU Cores', + 'refId': 'B', + 'step': 20, + }, + ], + ), + SingleStat( + title='CPU Cores', + dataSource='${DS_PROMETHEUS}', + id=2, + format='percent', + span=3, + gauge=Gauge(show=True), + sparkline=SparkLine(show=True), + valueFontSize='110%', + thresholds='80, 90', + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + targets=[ + { + 'expr': 'max(sum(kube_pod_container_resource_' + 'requests_cpu_cores) by (instance)) / min(sum' + '(kube_node_status_allocatable_cpu_cores) by ' + '(instance)) * 100', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 240, + }, + ], + ), + ], + ), + Row( + height=300, title='Memory', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Memory', + id=3, + dataSource='${DS_PROMETHEUS}', + description='This represents the total [memory resource ' + 'requests](https://kubernetes.io/docs/concepts/' + 'configuration/manage-compute-resources-container/' + '#meaning-of-memory) in the cluster.\nFor comparison ' + 'the total [allocatable memory](https://github.com/' + 'kubernetes/community/blob/master/contributors/' + 'design-proposals/node-allocatable.md) is also shown.', + dashLength=10, + dashes=False, + lineWidth=1, + isNew=False, + spaceLength=10, + span=9, + nullPointMode='null', + tooltip=Tooltip( + msResolution=False, valueType='individual' + ), + yAxes=YAxes( + YAxis(format='bytes', label='Memory', min=None), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'min(sum(kube_node_status_allocatable_' + 'memory_bytes) by (instance))', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': 'Allocatable Memory', + 'refId': 'A', + 'step': 20, + }, + { + 'expr': 'max(sum(kube_pod_container_resource_' + 'requests_memory_bytes) by (instance))', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': 'Requested Memory', + 'refId': 'B', + 'step': 20, + }, + ], + ), + SingleStat( + title='Memory', + dataSource='${DS_PROMETHEUS}', + id=4, + format='percent', + span=3, + gauge=Gauge(show=True), + sparkline=SparkLine(show=True), + valueFontSize='110%', + thresholds='80, 90', + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + targets=[ + { + 'expr': 'max(sum(kube_pod_container_resource_' + 'requests_memory_bytes) by (instance)) / ' + 'min(sum(kube_node_status_allocatable_memory_' + 'bytes) by (instance)) * 100', + 'intervalFactor': 2, + 'legendFormat': '', + 'refId': 'A', + 'step': 240, + }, + ], + ), + ], + ), + ], +) diff --git a/assets/grafana/nodes-dashboard.json b/assets/grafana/nodes-dashboard.json deleted file mode 100644 index 7ab526c3554fe2841087a6a343f456b3d90e631b..0000000000000000000000000000000000000000 --- a/assets/grafana/nodes-dashboard.json +++ /dev/null @@ -1,892 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" - } - ], - "annotations": { - "list": [] - }, - "description": "Dashboard to get an overview of one server", - "editable": true, - "gnetId": 22, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [], - "refresh": false, - "rows": [ - { - "collapse": false, - "height": "250px", - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 3, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "100 - (avg by (cpu) (irate(node_cpu{mode=\"idle\", instance=\"$server\"}[5m])) * 100)", - "hide": false, - "intervalFactor": 10, - "legendFormat": "{{cpu}}", - "refId": "A", - "step": 50 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Idle cpu", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percent", - "label": "cpu usage", - "logBase": 1, - "max": 100, - "min": 0, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 9, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "node_load1{instance=\"$server\"}", - "intervalFactor": 4, - "legendFormat": "load 1m", - "refId": "A", - "step": 20, - "target": "" - }, - { - "expr": "node_load5{instance=\"$server\"}", - "intervalFactor": 4, - "legendFormat": "load 5m", - "refId": "B", - "step": 20, - "target": "" - }, - { - "expr": "node_load15{instance=\"$server\"}", - "intervalFactor": 4, - "legendFormat": "load 15m", - "refId": "C", - "step": 20, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "System load", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "percentunit", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "250px", - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 4, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "hideEmpty": false, - "hideZero": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "node_memory_SwapFree{instance=\"172.17.0.1:9100\",job=\"prometheus\"}", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 9, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "node_memory_MemTotal{instance=\"$server\"} - node_memory_MemFree{instance=\"$server\"} - node_memory_Buffers{instance=\"$server\"} - node_memory_Cached{instance=\"$server\"}", - "hide": false, - "interval": "", - "intervalFactor": 2, - "legendFormat": "memory used", - "metric": "", - "refId": "C", - "step": 10 - }, - { - "expr": "node_memory_Buffers{instance=\"$server\"}", - "interval": "", - "intervalFactor": 2, - "legendFormat": "memory buffers", - "metric": "", - "refId": "E", - "step": 10 - }, - { - "expr": "node_memory_Cached{instance=\"$server\"}", - "intervalFactor": 2, - "legendFormat": "memory cached", - "metric": "", - "refId": "F", - "step": 10 - }, - { - "expr": "node_memory_MemFree{instance=\"$server\"}", - "intervalFactor": 2, - "legendFormat": "memory free", - "metric": "", - "refId": "D", - "step": 10 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Memory usage", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "format": "percent", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 5, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "((node_memory_MemTotal{instance=\"$server\"} - node_memory_MemFree{instance=\"$server\"} - node_memory_Buffers{instance=\"$server\"} - node_memory_Cached{instance=\"$server\"}) / node_memory_MemTotal{instance=\"$server\"}) * 100", - "intervalFactor": 2, - "refId": "A", - "step": 60, - "target": "" - } - ], - "thresholds": "80, 90", - "title": "Memory usage", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "250px", - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "read", - "yaxis": 1 - }, - { - "alias": "{instance=\"172.17.0.1:9100\"}", - "yaxis": 2 - }, - { - "alias": "io time", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 9, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (instance) (rate(node_disk_bytes_read{instance=\"$server\"}[2m]))", - "hide": false, - "intervalFactor": 4, - "legendFormat": "read", - "refId": "A", - "step": 20, - "target": "" - }, - { - "expr": "sum by (instance) (rate(node_disk_bytes_written{instance=\"$server\"}[2m]))", - "intervalFactor": 4, - "legendFormat": "written", - "refId": "B", - "step": 20 - }, - { - "expr": "sum by (instance) (rate(node_disk_io_time_ms{instance=\"$server\"}[2m]))", - "intervalFactor": 4, - "legendFormat": "io time", - "refId": "C", - "step": 20 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Disk I/O", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "ms", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 7, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "(sum(node_filesystem_size{device!=\"rootfs\",instance=\"$server\"}) - sum(node_filesystem_free{device!=\"rootfs\",instance=\"$server\"})) / sum(node_filesystem_size{device!=\"rootfs\",instance=\"$server\"})", - "intervalFactor": 2, - "refId": "A", - "step": 60, - "target": "" - } - ], - "thresholds": "0.75, 0.9", - "title": "Disk space usage", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "250px", - "panels": [ - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "transmitted ", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(node_network_receive_bytes{instance=\"$server\",device!~\"lo\"}[5m])", - "hide": false, - "intervalFactor": 2, - "legendFormat": "{{device}}", - "refId": "A", - "step": 10, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network received", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - }, - { - "alerting": {}, - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 10, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "transmitted ", - "yaxis": 2 - } - ], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(node_network_transmit_bytes{instance=\"$server\",device!~\"lo\"}[5m])", - "hide": false, - "intervalFactor": 2, - "legendFormat": "{{device}}", - "refId": "B", - "step": 10, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network transmitted", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "server", - "options": [], - "query": "label_values(node_boot_time, instance)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "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": "browser", - "title": "Nodes", - "version": 2 -} \ No newline at end of file diff --git a/assets/grafana/nodes.dashboard.py b/assets/grafana/nodes.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..f2e7b18ed72ba241a09c8c2bc34c726f79e80422 --- /dev/null +++ b/assets/grafana/nodes.dashboard.py @@ -0,0 +1,414 @@ +from grafanalib.core import * + + +dashboard = Dashboard( + title='Nodes', + version=2, + description='Dashboard to get an overview of one server', + gnetId=22, + graphTooltip=0, + refresh=False, + schemaVersion=14, + time=Time(start='now-1h'), + timezone='browser', + inputs=[ + { + 'name': 'DS_PROMETHEUS', + 'label': 'prometheus', + 'description': '', + 'type': 'datasource', + 'pluginId': 'prometheus', + 'pluginName': 'Prometheus' + }, + ], + templating=Templating(list=[ + { + 'allValue': None, + 'current': {}, + 'datasource': '${DS_PROMETHEUS}', + 'hide': 0, + 'includeAll': False, + 'label': None, + 'multi': False, + 'name': 'server', + 'options': [], + 'query': 'label_values(node_boot_time, instance)', + 'refresh': 1, + 'regex': '', + 'sort': 0, + 'tagValuesQuery': '', + 'tags': [], + 'tagsQuery': '', + 'type': 'query', + 'useTags': False, + }, + ]), + rows=[ + Row( + height=250, title='New Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Idle CPU', + dataSource='${DS_PROMETHEUS}', + id=3, + isNew=False, + spaceLength=10, + span=6, + dashLength=10, + dashes=False, + tooltip=Tooltip(msResolution=False), + yAxes=YAxes( + YAxis( + format='percent', + label='cpu usage', + max=100, + ), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': '100 - (avg by (cpu) (irate(node_cpu' + '{mode=\"idle\", instance=\"$server\"}[5m])) ' + '* 100)', + 'hide': False, + 'intervalFactor': 10, + 'legendFormat': '{{cpu}}', + 'refId': 'A', + 'step': 50, + } + ], + ), + Graph( + title='System Load', + dataSource='${DS_PROMETHEUS}', + id=9, + isNew=False, + spaceLength=10, + span=6, + dashLength=10, + dashes=False, + tooltip=Tooltip(msResolution=False), + yAxes=YAxes( + YAxis(format='percentunit', min=None,), + YAxis(format='short', min=None,), + ), + targets=[ + { + 'expr': 'node_load1{instance=\"$server\"}', + 'intervalFactor': 4, + 'legendFormat': 'load 1m', + 'refId': 'A', + 'step': 20, + 'target': '', + }, + { + 'expr': 'node_load5{instance=\"$server\"}', + 'intervalFactor': 4, + 'legendFormat': 'load 5m', + 'refId': 'B', + 'step': 20, + 'target': '', + }, + { + 'expr': 'node_load15{instance=\"$server\"}', + 'intervalFactor': 4, + 'legendFormat': 'load 15m', + 'refId': 'C', + 'step': 20, + 'target': '', + }, + ], + ), + ], + ), + Row( + height=250, title='New Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Memory Usage', + dataSource='${DS_PROMETHEUS}', + id=4, + isNew=False, + spaceLength=10, + span=9, + stack=True, + dashLength=10, + dashes=False, + tooltip=Tooltip( + msResolution=False, valueType='individual', + ), + seriesOverrides=[ + { + 'alias': 'node_memory_SwapFree{instance=' + '\"172.17.0.1:9100\",job=\"prometheus\"}', + 'yaxis': 2, + }, + ], + yAxes=YAxes( + YAxis(format='bytes', min='0',), + YAxis(format='short', min=None,), + ), + targets=[ + { + 'expr': 'node_memory_MemTotal{instance=' + '\"$server\"} - node_memory_MemFree{instance=' + '\"$server\"} - node_memory_Buffers{instance=' + '\"$server\"} - node_memory_Cached{instance=' + '\"$server\"}', + 'hide': False, + 'interval': '', + 'intervalFactor': 2, + 'legendFormat': 'memory used', + 'metric': '', + 'refId': 'C', + 'step': 10, + }, + { + 'expr': 'node_memory_Buffers{instance=' + '\"$server\"}', + 'interval': '', + 'intervalFactor': 2, + 'legendFormat': 'memory buffers', + 'metric': '', + 'refId': 'E', + 'step': 10, + }, + { + 'expr': 'node_memory_Cached{instance=\"$server\"}', + 'intervalFactor': 2, + 'legendFormat': 'memory cached', + 'metric': '', + 'refId': 'F', + 'step': 10, + }, + { + 'expr': 'node_memory_MemFree{instance=' + '\"$server\"}', + 'intervalFactor': 2, + 'legendFormat': 'memory free', + 'metric': '', + 'refId': 'D', + 'step': 10, + }, + ], + ), + SingleStat( + title='Memory Usage', + dataSource='${DS_PROMETHEUS}', + id=5, + format='percent', + gauge=Gauge(show=True), + span=3, + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + } + ], + thresholds='80, 90', + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + }, + ], + targets=[ + { + 'expr': '((node_memory_MemTotal{instance=' + '\"$server\"} - node_memory_MemFree{instance=' + '\"$server\"} - node_memory_Buffers{instance=' + '\"$server\"} - node_memory_Cached{instance=' + '\"$server\"}) / node_memory_MemTotal{instance=' + '\"$server\"}) * 100', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 60, + 'target': '', + }, + ], + ), + ], + ), + Row( + height=250, titleSize='h6', title='New Row', + showTitle=False, panels=[ + Graph( + title='Disk I/O', + dataSource='${DS_PROMETHEUS}', + id=6, + dashLength=10, + dashes=False, + spaceLength=10, + span=9, + tooltip=Tooltip(msResolution=False), + yAxes=YAxes( + YAxis( + format='bytes', + min=None, + ), + YAxis( + format='ms', + min=None, + ), + ), + seriesOverrides=[ + { + 'alias': 'read', + 'yaxis': 1, + }, + { + 'alias': '{instance=\"172.17.0.1:9100\"}', + 'yaxis': 2, + }, + { + 'alias': 'io time', + 'yaxis': 2, + }, + ], + targets=[ + { + 'expr': 'sum by (instance) (rate(node_disk_' + 'bytes_read{instance=\"$server\"}[2m]))', + 'hide': False, + 'intervalFactor': 4, + 'legendFormat': 'read', + 'refId': 'A', + 'step': 20, + 'target': '', + }, + { + 'expr': 'sum by (instance) (rate(node_disk_' + 'bytes_written{instance=\"$server\"}[2m]))', + 'intervalFactor': 4, + 'legendFormat': 'written', + 'refId': 'B', + 'step': 20 + }, + { + 'expr': 'sum by (instance) (rate(node_disk_io_' + 'time_ms{instance=\"$server\"}[2m]))', + 'intervalFactor': 4, + 'legendFormat': 'io time', + 'refId': 'C', + 'step': 20, + }, + ], + ), + SingleStat( + title='Disk Space Usage', + dataSource='${DS_PROMETHEUS}', + id=7, + thresholds='0.75, 0.9', + valueName='current', + format='percentunit', + span=3, + gauge=Gauge( + maxValue=1, + show=True, + ), + rangeMaps=[ + { + 'from': 'null', + 'text': 'N/A', + 'to': 'null', + }, + ], + valueMaps=[ + { + 'op': '=', + 'text': 'N/A', + 'value': 'null', + } + ], + targets=[ + { + 'expr': '(sum(node_filesystem_size{device!=' + '\"rootfs\",instance=\"$server\"}) - ' + 'sum(node_filesystem_free{device!=\"rootfs\",' + 'instance=\"$server\"})) / sum(node_filesystem_' + 'size{device!=\"rootfs\",instance=\"$server\"})', + 'intervalFactor': 2, + 'refId': 'A', + 'step': 60, + 'target': '', + }, + ], + ), + ], + ), + Row( + height=250, title='New Row', titleSize='h6', + showTitle=False, + panels=[ + Graph( + title='Network Received', + dataSource='${DS_PROMETHEUS}', + id=8, + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=6, + tooltip=Tooltip(msResolution=False), + yAxes=YAxes( + YAxis(format='bytes', min=None), + YAxis(format='bytes', min=None), + ), + seriesOverrides=[ + { + 'alias': 'transmitted', + 'yaxis': 2, + }, + ], + targets=[ + { + 'expr': 'rate(node_network_receive_bytes{' + 'instance=\"$server\",device!~\"lo\"}[5m])', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': '{{device}}', + 'refId': 'A', + 'step': 10, + 'target': '' + } + ], + ), + Graph( + title='Network Transmitted', + dataSource='${DS_PROMETHEUS}', + id=10, + dashLength=10, + dashes=False, + isNew=False, + spaceLength=10, + span=6, + tooltip=Tooltip(msResolution=False), + yAxes=YAxes( + YAxis(format='bytes', min=None), + YAxis(format='bytes', min=None), + ), + seriesOverrides=[ + { + 'alias': 'transmitted', + 'yaxis': 2, + }, + ], + targets=[ + { + 'expr': 'rate(node_network_transmit_bytes' + '{instance=\"$server\",device!~\"lo\"}[5m])', + 'hide': False, + 'intervalFactor': 2, + 'legendFormat': '{{device}}', + 'refId': 'B', + 'step': 10, + 'target': '', + }, + ], + ), + ], + ), + ], +) diff --git a/assets/grafana/pods-dashboard.json b/assets/grafana/pods-dashboard.json deleted file mode 100644 index 2d3c1c84c30b7a4089c4a4a9596087f6af55a571..0000000000000000000000000000000000000000 --- a/assets/grafana/pods-dashboard.json +++ /dev/null @@ -1,432 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - } - ], - "annotations": { - "list": [] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 1, - "hideControls": false, - "id": null, - "links": [], - "rows": [ - { - "collapse": false, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 1, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by(container_name) (container_memory_usage_bytes{pod_name=\"$pod\", container_name=~\"$container\", container_name!=\"POD\"})", - "interval": "10s", - "intervalFactor": 1, - "legendFormat": "Current: {{ container_name }}", - "metric": "container_memory_usage_bytes", - "refId": "A", - "step": 15 - }, - { - "expr": "kube_pod_container_resource_requests_memory_bytes{pod=\"$pod\", container=~\"$container\"}", - "interval": "10s", - "intervalFactor": 2, - "legendFormat": "Requested: {{ container }}", - "metric": "kube_pod_container_resource_requests_memory_bytes", - "refId": "B", - "step": 20 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Memory Usage", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 2, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (container_name)( rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\",pod_name=\"$pod\"}[1m] ) )", - "intervalFactor": 2, - "legendFormat": "{{ container_name }}", - "refId": "A", - "step": 30 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "CPU Usage", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "id": 3, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sort_desc(sum by (pod_name) (rate (container_network_receive_bytes_total{pod_name=\"$pod\"}[1m]) ))", - "intervalFactor": 2, - "legendFormat": "{{ pod_name }}", - "refId": "A", - "step": 30 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network I/O", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "New row", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": ".*", - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": true, - "label": "Namespace", - "multi": false, - "name": "namespace", - "options": [], - "query": "label_values(kube_pod_info, namespace)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": false, - "label": "Pod", - "multi": false, - "name": "pod", - "options": [], - "query": "label_values(kube_pod_info{namespace=~\"$namespace\"}, pod)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": true, - "label": "Container", - "multi": false, - "name": "container", - "options": [], - "query": "label_values(kube_pod_container_info{namespace=\"$namespace\", pod=\"$pod\"}, container)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": 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" - ] - }, - "timezone": "browser", - "title": "Pods", - "version": 1 -} \ No newline at end of file diff --git a/assets/grafana/pods.dashboard.py b/assets/grafana/pods.dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..1003d8a51a5d0a43f8538d4f153069caa5e4e7cc --- /dev/null +++ b/assets/grafana/pods.dashboard.py @@ -0,0 +1,215 @@ +from grafanalib.core import * + + +dashboard = Dashboard( + title='Pods', + version=1, + graphTooltip=1, + refresh=False, + schemaVersion=14, + time=Time(start='now-6h'), + timezone='browser', + inputs=[ + { + 'name': 'DS_PROMETHEUS', + 'label': 'prometheus', + 'description': '', + 'type': 'datasource', + 'pluginId': 'prometheus', + 'pluginName': 'Prometheus' + }, + ], + templating=Templating(list=[ + { + 'allValue': '.*', + 'current': {}, + 'datasource': '${DS_PROMETHEUS}', + 'hide': 0, + 'includeAll': True, + 'label': 'Namespace', + 'multi': False, + 'name': 'namespace', + 'options': [], + 'query': 'label_values(kube_pod_info, namespace)', + 'refresh': 1, + 'regex': '', + 'sort': 0, + 'tagValuesQuery': '', + 'tags': [], + 'tagsQuery': '', + 'type': 'query', + 'useTags': False, + }, + { + 'allValue': None, + 'current': {}, + 'datasource': '${DS_PROMETHEUS}', + 'hide': 0, + 'includeAll': False, + 'label': 'Pod', + 'multi': False, + 'name': 'pod', + 'options': [], + 'query': 'label_values(kube_pod_info{namespace=~"$namespace"}, ' + 'pod)', + 'refresh': 1, + 'regex': '', + 'sort': 0, + 'tagValuesQuery': '', + 'tags': [], + 'tagsQuery': '', + 'type': 'query', + 'useTags': False, + }, + { + 'allValue': '.*', + 'current': {}, + 'datasource': '${DS_PROMETHEUS}', + 'hide': 0, + 'includeAll': True, + 'label': 'Container', + 'multi': False, + 'name': 'container', + 'options': [], + 'query': 'label_values(kube_pod_container_info{namespace=' + '"$namespace", pod="$pod"}, container)', + 'refresh': 1, + 'regex': '', + 'sort': 0, + 'tagValuesQuery': '', + 'tags': [], + 'tagsQuery': '', + 'type': 'query', + 'useTags': False, + }, + ]), + rows=[ + Row( + height=250, title='Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Memory Usage', + dataSource='${DS_PROMETHEUS}', + id=1, + isNew=False, + spaceLength=10, + span=12, + dashLength=10, + dashes=False, + tooltip=Tooltip(msResolution=True, valueType='cumulative'), + legend=Legend( + alignAsTable=True, avg=True, current=True, + rightSide=True, total=False, values=True, + ), + yAxes=YAxes( + YAxis( + format='bytes', min=None, + ), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum by(container_name) (container_' + 'memory_usage_bytes{pod_name="$pod", ' + 'container_name=~"$container", ' + 'container_name!="POD"})', + 'interval': '10s', + 'intervalFactor': 1, + 'legendFormat': 'Current: {{ container_name }}', + 'metric': 'container_memory_usage_bytes', + 'refId': 'A', + 'step': 15, + }, + { + 'expr': 'kube_pod_container_resource_requests_' + 'memory_bytes{pod="$pod", container=~' + '"$container"}', + 'interval': '10s', + 'intervalFactor': 2, + 'legendFormat': 'Requested: {{ container }}', + 'metric': 'kube_pod_container_resource_' + 'requests_memory_bytes', + 'refId': 'B', + 'step': 20, + }, + ], + ), + ], + ), + Row( + height=250, title='Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='CPU Usage', + dataSource='${DS_PROMETHEUS}', + id=2, + isNew=False, + spaceLength=10, + span=12, + dashLength=10, + dashes=False, + legend=Legend( + alignAsTable=True, avg=True, current=True, + rightSide=True, total=False, values=True, + ), + tooltip=Tooltip(msResolution=True, valueType='cumulative'), + yAxes=YAxes( + YAxis( + format='short', min=None, + ), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sum by (container_name)(' + 'rate(container_cpu_usage_seconds_total' + '{image!="",container_name!="POD",pod_name=' + '"$pod"}[1m]))', + 'intervalFactor': 2, + 'legendFormat': '{{ container_name }}', + 'refId': 'A', + 'step': 30 + }, + ], + ), + ], + ), + Row( + height=250, title='New Row', showTitle=False, + titleSize='h6', panels=[ + Graph( + title='Network I/O', + dataSource='${DS_PROMETHEUS}', + id=3, + isNew=False, + spaceLength=10, + span=12, + dashLength=10, + dashes=False, + legend=Legend( + alignAsTable=True, avg=True, current=True, + rightSide=True, total=False, values=True, + ), + tooltip=Tooltip(msResolution=True, valueType='cumulative'), + yAxes=YAxes( + YAxis( + format='bytes', min=None, + ), + YAxis(format='short', min=None), + ), + targets=[ + { + 'expr': 'sort_desc(sum by (pod_name) (rate' + '(container_network_receive_bytes_total{' + 'pod_name="$pod"}[1m])))', + 'intervalFactor': 2, + 'legendFormat': '{{ pod_name }}', + 'refId': 'A', + 'step': 30 + }, + ], + ), + ], + ), + ], +) diff --git a/hack/grafana-dashboards-configmap-generator/bin/grafana_dashboards_generate.sh b/hack/grafana-dashboards-configmap-generator/bin/grafana_dashboards_generate.sh index 0a37c4918a0fe66ebe91fa53dbe890ff2d20cad3..b4273baa707497a6cdfe3eb3fa52435f10247427 100755 --- a/hack/grafana-dashboards-configmap-generator/bin/grafana_dashboards_generate.sh +++ b/hack/grafana-dashboards-configmap-generator/bin/grafana_dashboards_generate.sh @@ -226,7 +226,7 @@ bin-pack-files() { # the max size of the queue is limited by DATA_SIZE_LIMIT # while there's room available in the queue we add files. # when there's no room we create a configmap with the members of the queue - # before adding the file to a cleaned queue + # before adding the file to a cleaned queue # Counters initialization is not in the scope of this function local file="" @@ -313,7 +313,7 @@ touch $GRAFANA_OUTPUT_FILE || { echo "ERROR: Unable to create or modify $GRAFANA echo "# Starting execution of $SCRIPT_BASE on $DATE_EXEC" echo "# Configured size limit: $DATA_SIZE_LIMIT bytes" -echo "# Grafna input dashboards and datasources will be read from: $DASHBOARDS_DIR" +echo "# Grafana input dashboards and datasources will be read from: $DASHBOARDS_DIR" echo "# Grafana Dashboards ConfigMap will be created into file:" echo "$OUTPUT_FILE" echo "# Grafana Deployment manifest will be created into file:" diff --git a/hack/scripts/generate-dashboards-configmap.sh b/hack/scripts/generate-dashboards-configmap.sh index 78ad27acc531c759b3390069e6e36e3ff1480fba..5b0ed3e860a378d25cde7e35ef277dd2c69be420 100755 --- a/hack/scripts/generate-dashboards-configmap.sh +++ b/hack/scripts/generate-dashboards-configmap.sh @@ -1,13 +1,23 @@ #!/bin/bash +set -e cat <<-EOF apiVersion: v1 kind: ConfigMap metadata: - name: grafana-dashboards + name: grafana-dashboards-0 data: EOF +virtualenv -p python3 .env +source .env/bin/activate +pip install -Ur requirements.txt +for f in assets/grafana/*.dashboard.py +do + JSON_FILENAME="$(pwd)/${f%%.*}-dashboard.json" + generate-dashboard $f -o $JSON_FILENAME 2>&1 > /dev/null +done + for f in assets/grafana/*-dashboard.json do echo " $(basename $f): |+" diff --git a/hack/scripts/generate-manifests.sh b/hack/scripts/generate-manifests.sh index bb0c0685695abf5b0a618d2a72683ea137ba0e02..7f300dac1820087cf02ae9116c3e8742c17c4356 100755 --- a/hack/scripts/generate-manifests.sh +++ b/hack/scripts/generate-manifests.sh @@ -1,10 +1,11 @@ #!/bin/bash +set -e # Generate Alert Rules ConfigMap hack/scripts/generate-rules-configmap.sh > manifests/prometheus/prometheus-k8s-rules.yaml # Generate Dashboard ConfigMap -#hack/scripts/generate-dashboards-configmap.sh > manifests/grafana/grafana-dashboards.yaml +hack/scripts/generate-dashboards-configmap.sh > manifests/grafana/grafana-dashboards.yaml # Generate Dashboard ConfigMap with configmap-generator tool # Max Size per ConfigMap: 240000 diff --git a/manifests/grafana/grafana-dashboards.yaml b/manifests/grafana/grafana-dashboards.yaml index 13dc4e64cb451c2fe8467dcaabd62a673c367352..e76a1103ef8374b9c64471b1c2c8b65a57094d42 100644 --- a/manifests/grafana/grafana-dashboards.yaml +++ b/manifests/grafana/grafana-dashboards.yaml @@ -9,48 +9,20 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { "list": [] }, "editable": true, - "gnetId": null, "graphTooltip": 1, "hideControls": false, - "id": null, "links": [], "rows": [ { @@ -58,7 +30,6 @@ data: "height": "200px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -68,7 +39,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "none", "gauge": { "maxValue": 100, @@ -78,7 +48,6 @@ data: "thresholdMarkers": true }, "id": 8, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -93,7 +62,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "cores", "postfixFontSize": "50%", "prefix": "", @@ -112,16 +80,14 @@ data: "lineColor": "rgb(31, 120, 193)", "show": true }, - "tableColumn": "", "targets": [ { - "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, "refId": "A", "step": 600 } ], - "thresholds": "", "title": "CPU", "type": "singlestat", "valueFontSize": "110%", @@ -135,7 +101,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -145,7 +110,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "none", "gauge": { "maxValue": 100, @@ -155,7 +119,6 @@ data: "thresholdMarkers": true }, "id": 9, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -170,7 +133,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "GB", "postfixFontSize": "50%", "prefix": "", @@ -189,7 +151,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": true }, - "tableColumn": "", "targets": [ { "expr": "sum(container_memory_usage_bytes{namespace=\"$deployment_namespace\",pod_name=~\"$deployment_name.*\"}) / 1024^3", @@ -198,7 +159,6 @@ data: "step": 600 } ], - "thresholds": "", "title": "Memory", "type": "singlestat", "valueFontSize": "110%", @@ -212,7 +172,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -222,7 +181,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "Bps", "gauge": { "maxValue": 100, @@ -232,7 +190,6 @@ data: "thresholdMarkers": false }, "id": 7, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -247,7 +204,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -266,16 +222,14 @@ data: "lineColor": "rgb(31, 120, 193)", "show": true }, - "tableColumn": "", "targets": [ { - "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, "refId": "A", "step": 600 } ], - "thresholds": "", "title": "Network", "type": "singlestat", "valueFontSize": "80%", @@ -289,11 +243,8 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "Row", + "title": "Dashboard Row", "titleSize": "h6" }, { @@ -301,7 +252,6 @@ data: "height": "100px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -310,9 +260,7 @@ data: "rgba(50, 172, 45, 0.97)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, "editable": true, - "error": false, "format": "none", "gauge": { "maxValue": 100, @@ -322,7 +270,6 @@ data: "thresholdMarkers": false }, "id": 5, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -337,8 +284,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -356,7 +301,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "max(kube_deployment_spec_replicas{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", @@ -366,7 +310,6 @@ data: "step": 600 } ], - "thresholds": "", "title": "Desired Replicas", "type": "singlestat", "valueFontSize": "80%", @@ -380,7 +323,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -390,7 +332,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "none", "gauge": { "maxValue": 100, @@ -400,7 +341,6 @@ data: "thresholdMarkers": true }, "id": 6, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -415,8 +355,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -434,7 +372,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "min(kube_deployment_status_replicas_available{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", @@ -443,7 +380,6 @@ data: "step": 600 } ], - "thresholds": "", "title": "Available Replicas", "type": "singlestat", "valueFontSize": "80%", @@ -457,7 +393,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -467,7 +402,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "none", "gauge": { "maxValue": 100, @@ -477,7 +411,6 @@ data: "thresholdMarkers": true }, "id": 3, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -492,8 +425,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -511,17 +442,14 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "max(kube_deployment_status_observed_generation{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "", "title": "Observed Generation", "type": "singlestat", "valueFontSize": "80%", @@ -535,7 +463,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -545,7 +472,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "none", "gauge": { "maxValue": 100, @@ -555,7 +481,6 @@ data: "thresholdMarkers": true }, "id": 2, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -570,8 +495,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -589,17 +512,14 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "max(kube_deployment_metadata_generation{deployment=\"$deployment_name\",namespace=\"$deployment_namespace\"}) without (instance, pod)", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "", "title": "Metadata Generation", "type": "singlestat", "valueFontSize": "80%", @@ -613,11 +533,8 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "Dashboard Row", "titleSize": "h6" }, { @@ -633,17 +550,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 1, + "isNew": true, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -695,9 +618,6 @@ data: "step": 30 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "Replicas", "tooltip": { "msResolution": true, @@ -705,12 +625,9 @@ data: "sort": 0, "value_type": "cumulative" }, - "transparent": false, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, @@ -719,30 +636,24 @@ data: "format": "none", "label": "", "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, + "label": "", "logBase": 1, - "max": null, - "min": null, "show": false } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "Dashboard Row", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -821,7 +732,8 @@ data: "timezone": "browser", "title": "Deployment", "version": 1 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -838,58 +750,30 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { "list": [] }, - "description": "", "editable": true, "gnetId": 22, "graphTooltip": 0, "hideControls": false, - "id": null, "links": [], "refresh": false, "rows": [ { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -898,16 +782,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 3, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -932,10 +823,7 @@ data: "step": 50 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Idle cpu", + "title": "Idle CPU", "tooltip": { "msResolution": false, "shared": true, @@ -944,9 +832,7 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, @@ -955,22 +841,17 @@ data: "format": "percent", "label": "cpu usage", "logBase": 1, - "max": null, "min": 0, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -979,16 +860,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 9, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -1029,10 +917,7 @@ data: "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "System load", + "title": "System Load", "tooltip": { "msResolution": false, "shared": true, @@ -1041,45 +926,34 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "percentunit", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" }, { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -1088,16 +962,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 4, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -1158,10 +1039,7 @@ data: "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Memory usage", + "title": "Memory Usage", "tooltip": { "msResolution": false, "shared": true, @@ -1170,33 +1048,25 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, "min": "0", "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -1206,7 +1076,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "percent", "gauge": { "maxValue": 100, @@ -1215,8 +1084,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 5, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -1231,7 +1100,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -1250,7 +1118,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "((sum(node_memory_MemTotal) - sum(node_memory_MemFree) - sum(node_memory_Buffers) - sum(node_memory_Cached)) / sum(node_memory_MemTotal)) * 100", @@ -1262,7 +1129,8 @@ data: } ], "thresholds": "80, 90", - "title": "Memory usage", + "title": "Memory Usage", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -1275,19 +1143,16 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" }, { "collapse": false, - "height": 246, + "editable": true, + "height": "246px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -1296,16 +1161,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 6, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -1358,9 +1230,6 @@ data: "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "Disk I/O", "tooltip": { "msResolution": false, @@ -1370,33 +1239,24 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "ms", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -1406,7 +1266,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "percentunit", "gauge": { "maxValue": 1, @@ -1415,8 +1274,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 12, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -1431,7 +1290,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -1450,7 +1308,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(node_filesystem_size{device!=\"rootfs\"}) - sum(node_filesystem_free{device!=\"rootfs\"})) / sum(node_filesystem_size{device!=\"rootfs\"})", @@ -1461,7 +1318,8 @@ data: } ], "thresholds": "0.75, 0.9", - "title": "Disk space usage", + "title": "Disk Space Usage", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -1474,19 +1332,16 @@ data: "valueName": "current" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" }, { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -1495,16 +1350,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 8, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -1516,7 +1378,7 @@ data: "renderer": "flot", "seriesOverrides": [ { - "alias": "transmitted ", + "alias": "transmitted", "yaxis": 2 } ], @@ -1535,10 +1397,7 @@ data: "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network received", + "title": "Network Received", "tooltip": { "msResolution": false, "shared": true, @@ -1547,33 +1406,24 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -1582,16 +1432,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 10, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -1603,7 +1460,7 @@ data: "renderer": "flot", "seriesOverrides": [ { - "alias": "transmitted ", + "alias": "transmitted", "yaxis": 2 } ], @@ -1622,10 +1479,7 @@ data: "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network transmitted", + "title": "Network Transmitted", "tooltip": { "msResolution": false, "shared": true, @@ -1634,70 +1488,69 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" }, { "collapse": false, - "height": 276, + "editable": true, + "height": "276px", "panels": [ { "aliasColors": {}, "bars": false, - "dashLength": 10, "dashes": false, "datasource": "${DS_PROMETHEUS}", + "editable": true, + "error": false, "fill": 1, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 11, + "isNew": true, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, - "linewidth": 1, + "linewidth": 2, "links": [], - "nullPointMode": "null", + "nullPointMode": "connected", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], - "spaceLength": 10, + "spaceLength": 11, "span": 9, "stack": false, "steppedLine": false, @@ -1719,44 +1572,33 @@ data: "step": 10 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "Cluster Pod Utilization", "tooltip": { + "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -1766,7 +1608,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "percent", "gauge": { "maxValue": 100, @@ -1775,8 +1616,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 7, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -1791,7 +1632,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -1810,7 +1650,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "100 - (sum(kube_node_status_capacity_pods) - sum(kube_pod_info)) / sum(kube_node_status_capacity_pods) * 100", @@ -1822,8 +1661,9 @@ data: "target": "" } ], - "thresholds": "80,90", + "thresholds": "80, 90", "title": "Pod Utilization", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -1836,15 +1676,13 @@ data: "valueName": "current" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "Dashboard Row", + "title": "New Row", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -1882,7 +1720,8 @@ data: "timezone": "browser", "title": "Kubernetes Capacity Planning", "version": 4 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -1899,50 +1738,29 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { "list": [] }, "editable": true, - "gnetId": null, "graphTooltip": 0, "hideControls": false, - "id": null, "links": [], + "refresh": "10s", "rows": [ { "collapse": false, - "height": 254, + "editable": true, + "height": "254px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -1951,6 +1769,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -1959,8 +1778,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 1, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -1975,7 +1794,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -1994,7 +1812,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(up{job=~\"apiserver|kube-scheduler|kube-controller-manager\"} == 0)", @@ -2005,8 +1822,9 @@ data: "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Control Plane Components Down", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2024,7 +1842,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2033,7 +1850,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2042,8 +1859,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 2, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2058,7 +1875,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -2077,7 +1893,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(ALERTS{alertstate=\"firing\",alertname!=\"DeadMansSwitch\"})", @@ -2088,8 +1903,9 @@ data: "step": 600 } ], - "thresholds": "3,5", + "thresholds": "1, 3", "title": "Alerts Firing", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2102,7 +1918,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2111,7 +1926,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2120,8 +1935,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 3, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2136,7 +1951,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -2155,7 +1969,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(ALERTS{alertstate=\"pending\",alertname!=\"DeadMansSwitch\"})", @@ -2166,8 +1979,9 @@ data: "step": 600 } ], - "thresholds": "3,5", + "thresholds": "3, 5", "title": "Alerts Pending", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2180,7 +1994,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2189,7 +2002,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2198,8 +2011,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 4, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2214,7 +2027,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -2233,7 +2045,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "count(increase(kube_pod_container_status_restarts[1h]) > 5)", @@ -2244,8 +2055,9 @@ data: "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Crashlooping Pods", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2258,19 +2070,16 @@ data: "valueName": "current" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "Dashboard Row", + "title": "Row", "titleSize": "h6" }, { "collapse": false, - "height": 250, + "editable": true, + "height": "250px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2279,7 +2088,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2288,8 +2097,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 5, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2304,7 +2113,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -2323,7 +2131,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(kube_node_status_condition{condition=\"Ready\",status!=\"true\"})", @@ -2334,8 +2141,9 @@ data: "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Node Not Ready", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2348,7 +2156,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2357,7 +2164,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2366,8 +2173,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 6, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2382,7 +2189,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -2401,7 +2207,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(kube_node_status_condition{condition=\"DiskPressure\",status=\"true\"})", @@ -2412,8 +2217,9 @@ data: "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Node Disk Pressure", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2426,7 +2232,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2435,7 +2240,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2444,8 +2249,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 7, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2460,7 +2265,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -2479,7 +2283,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(kube_node_status_condition{condition=\"MemoryPressure\",status=\"true\"})", @@ -2490,8 +2293,9 @@ data: "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Node Memory Pressure", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2504,7 +2308,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2513,7 +2316,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2522,8 +2325,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 8, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2538,7 +2341,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -2557,7 +2359,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(kube_node_spec_unschedulable)", @@ -2568,8 +2369,9 @@ data: "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Nodes Unschedulable", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -2582,15 +2384,13 @@ data: "valueName": "current" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "Dashboard Row", + "title": "Row", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -2625,10 +2425,11 @@ data: "30d" ] }, - "timezone": "", + "timezone": "browser", "title": "Kubernetes Cluster Health", "version": 9 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -2645,50 +2446,27 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { "list": [] }, "editable": true, - "gnetId": null, "graphTooltip": 0, "hideControls": false, - "id": null, "links": [], "rows": [ { "collapse": false, - "height": 129, + "height": "129px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2697,6 +2475,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2706,7 +2485,6 @@ data: "thresholdMarkers": true }, "id": 5, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2721,8 +2499,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -2740,18 +2516,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(up{job=~\"apiserver|kube-scheduler|kube-controller-manager\"} == 0)", "format": "time_series", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Control Plane UP", "type": "singlestat", "valueFontSize": "80%", @@ -2765,7 +2539,6 @@ data: "valueName": "total" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -2774,6 +2547,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -2783,7 +2557,6 @@ data: "thresholdMarkers": true }, "id": 6, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2798,8 +2571,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -2817,18 +2588,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(ALERTS{alertstate=\"firing\",alertname!=\"DeadMansSwitch\"})", "format": "time_series", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "3,5", + "thresholds": "3, 5", "title": "Alerts Firing", "type": "singlestat", "valueFontSize": "80%", @@ -2842,19 +2611,15 @@ data: "valueName": "current" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": true, "title": "Cluster Health", "titleSize": "h6" }, { "collapse": false, - "height": 168, + "height": "168px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -2863,7 +2628,7 @@ data: "rgba(50, 172, 45, 0.97)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -2873,7 +2638,6 @@ data: "thresholdMarkers": true }, "id": 1, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2888,8 +2652,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -2907,19 +2669,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(up{job=\"apiserver\"} == 1) / count(up{job=\"apiserver\"})) * 100", "format": "time_series", - "interval": "", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "50,80", + "thresholds": "50, 80", "title": "API Servers UP", "type": "singlestat", "valueFontSize": "80%", @@ -2933,7 +2692,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -2942,7 +2700,7 @@ data: "rgba(50, 172, 45, 0.97)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -2952,7 +2710,6 @@ data: "thresholdMarkers": true }, "id": 2, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -2967,8 +2724,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -2986,19 +2741,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(up{job=\"kube-controller-manager\"} == 1) / count(up{job=\"kube-controller-manager\"})) * 100", "format": "time_series", - "interval": "", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "50,80", + "thresholds": "50, 80", "title": "Controller Managers UP", "type": "singlestat", "valueFontSize": "80%", @@ -3012,7 +2764,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3021,7 +2772,7 @@ data: "rgba(50, 172, 45, 0.97)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3031,7 +2782,6 @@ data: "thresholdMarkers": true }, "id": 3, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3046,8 +2796,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -3065,19 +2813,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(up{job=\"kube-scheduler\"} == 1) / count(up{job=\"kube-scheduler\"})) * 100", "format": "time_series", - "interval": "", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "50,80", + "thresholds": "50, 80", "title": "Schedulers UP", "type": "singlestat", "valueFontSize": "80%", @@ -3091,7 +2836,6 @@ data: "valueName": "current" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ @@ -3100,7 +2844,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "none", "gauge": { "maxValue": 100, @@ -3109,9 +2853,7 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, - "hideTimeOverride": false, "id": 4, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3126,8 +2868,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -3145,19 +2885,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "count(increase(kube_pod_container_status_restarts{namespace=~\"kube-system|tectonic-system\"}[1h]) > 5)", "format": "time_series", - "interval": "", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "1,3", + "thresholds": "1, 3", "title": "Crashlooping Control Plane Pods", "type": "singlestat", "valueFontSize": "80%", @@ -3171,19 +2908,15 @@ data: "valueName": "current" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": true, "title": "Control Plane Status", "titleSize": "h6" }, { "collapse": false, - "height": 158, + "height": "158px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3192,6 +2925,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3201,7 +2935,6 @@ data: "thresholdMarkers": true }, "id": 8, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3216,8 +2949,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -3235,18 +2966,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "sum(100 - (avg by (instance) (rate(node_cpu{job=\"node-exporter\",mode=\"idle\"}[5m])) * 100)) / count(node_cpu{job=\"node-exporter\",mode=\"idle\"})", "format": "time_series", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "80,90", + "thresholds": "80, 90", "title": "CPU Utilization", "type": "singlestat", "valueFontSize": "80%", @@ -3260,7 +2989,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3269,6 +2997,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3278,7 +3007,6 @@ data: "thresholdMarkers": true }, "id": 7, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3293,8 +3021,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -3312,18 +3038,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "((sum(node_memory_MemTotal) - sum(node_memory_MemFree) - sum(node_memory_Buffers) - sum(node_memory_Cached)) / sum(node_memory_MemTotal)) * 100", "format": "time_series", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "80,90", + "thresholds": "80, 90", "title": "Memory Utilization", "type": "singlestat", "valueFontSize": "80%", @@ -3337,7 +3061,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3346,6 +3069,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3355,7 +3079,6 @@ data: "thresholdMarkers": true }, "id": 9, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3370,8 +3093,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -3389,18 +3110,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(node_filesystem_size{device!=\"rootfs\"}) - sum(node_filesystem_free{device!=\"rootfs\"})) / sum(node_filesystem_size{device!=\"rootfs\"})", "format": "time_series", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "80,90", + "thresholds": "80, 90", "title": "Filesystem Utilization", "type": "singlestat", "valueFontSize": "80%", @@ -3414,7 +3133,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3423,6 +3141,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3432,7 +3151,6 @@ data: "thresholdMarkers": true }, "id": 10, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3447,8 +3165,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, - "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", @@ -3466,18 +3182,16 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "100 - (sum(kube_node_status_capacity_pods) - sum(kube_pod_info)) / sum(kube_node_status_capacity_pods) * 100", "format": "time_series", "intervalFactor": 2, - "legendFormat": "", "refId": "A", "step": 600 } ], - "thresholds": "80,90", + "thresholds": "80, 90", "title": "Pod Utilization", "type": "singlestat", "valueFontSize": "80%", @@ -3491,15 +3205,13 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": true, - "title": "Capacity Planing", + "title": "Capacity Planning", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -3534,10 +3246,11 @@ data: "30d" ] }, - "timezone": "", + "timezone": "browser", "title": "Kubernetes Cluster Status", "version": 3 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -3554,56 +3267,28 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { "list": [] }, "editable": true, - "gnetId": null, "graphTooltip": 0, "hideControls": false, - "id": null, "links": [], "rows": [ { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3612,6 +3297,7 @@ data: "rgba(50, 172, 45, 0.97)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3620,8 +3306,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 1, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3636,7 +3322,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -3655,7 +3340,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(up{job=\"apiserver\"} == 1) / sum(up{job=\"apiserver\"})) * 100", @@ -3665,8 +3349,9 @@ data: "step": 600 } ], - "thresholds": "50,80", + "thresholds": "50, 80", "title": "API Servers UP", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -3679,7 +3364,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3688,6 +3372,7 @@ data: "rgba(50, 172, 45, 0.97)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3696,8 +3381,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 2, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3712,7 +3397,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -3731,7 +3415,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(up{job=\"kube-controller-manager\"} == 1) / sum(up{job=\"kube-controller-manager\"})) * 100", @@ -3741,8 +3424,9 @@ data: "step": 600 } ], - "thresholds": "50,80", - "title": "Controller Mangers UP", + "thresholds": "50, 80", + "title": "Controller Managers UP", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -3755,7 +3439,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3764,6 +3447,7 @@ data: "rgba(50, 172, 45, 0.97)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3772,8 +3456,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 3, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3788,7 +3472,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -3807,7 +3490,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(up{job=\"kube-scheduler\"} == 1) / sum(up{job=\"kube-scheduler\"})) * 100", @@ -3817,8 +3499,9 @@ data: "step": 600 } ], - "thresholds": "50,80", + "thresholds": "50, 80", "title": "Schedulers UP", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -3831,7 +3514,6 @@ data: "valueName": "avg" }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -3840,6 +3522,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -3848,8 +3531,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 4, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -3864,7 +3547,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -3883,7 +3565,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "max(sum by(instance) (rate(apiserver_request_count{code=~\"5..\"}[5m])) / sum by(instance) (rate(apiserver_request_count[5m]))) * 100", @@ -3894,8 +3575,9 @@ data: "step": 600 } ], - "thresholds": "5,10", + "thresholds": "5, 10", "title": "API Server Request Error Rate", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -3908,16 +3590,14 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, "title": "Dashboard Row", "titleSize": "h6" }, { "collapse": false, - "height": 250, + "editable": true, + "height": "250px", "panels": [ { "aliasColors": {}, @@ -3925,16 +3605,26 @@ data: "dashLength": 10, "dashes": false, "datasource": "${DS_PROMETHEUS}", + "editable": true, + "error": false, "fill": 1, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 7, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 1, @@ -3959,53 +3649,41 @@ data: "step": 30 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "API Server Request Latency", "tooltip": { + "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, "title": "Dashboard Row", "titleSize": "h6" }, { "collapse": false, - "height": 250, + "editable": true, + "height": "250px", "panels": [ { "aliasColors": {}, @@ -4013,16 +3691,26 @@ data: "dashLength": 10, "dashes": false, "datasource": "${DS_PROMETHEUS}", + "editable": true, + "error": false, "fill": 1, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 5, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 1, @@ -4046,38 +3734,28 @@ data: "step": 60 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "End to end scheduling latency", + "title": "End to End Scheduling Latency", "tooltip": { + "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "dtdurations", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] @@ -4088,16 +3766,26 @@ data: "dashLength": 10, "dashes": false, "datasource": "${DS_PROMETHEUS}", + "editable": true, + "error": false, "fill": 1, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 6, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 1, @@ -4130,52 +3818,40 @@ data: "step": 60 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "API Server Request Rates", "tooltip": { + "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, "title": "Dashboard Row", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -4210,10 +3886,11 @@ data: "30d" ] }, - "timezone": "", + "timezone": "browser", "title": "Kubernetes Control Plane Status", "version": 3 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -4230,54 +3907,27 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { "list": [] }, - "description": "", "editable": true, - "gnetId": null, "graphTooltip": 0, "hideControls": false, - "id": null, "links": [], + "refresh": false, "rows": [ { "collapse": false, - "height": "300", + "editable": true, + "height": "300px", "panels": [ { "aliasColors": {}, @@ -4286,16 +3936,26 @@ data: "dashes": false, "datasource": "${DS_PROMETHEUS}", "description": "This represents the total [CPU resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu) in the cluster.\nFor comparison the total [allocatable CPU cores](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node-allocatable.md) is also shown.", + "editable": true, + "error": false, "fill": 1, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 1, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 1, @@ -4321,26 +3981,23 @@ data: }, { "expr": "max(sum(kube_pod_container_resource_requests_cpu_cores) by (instance))", + "hide": false, "intervalFactor": 2, "legendFormat": "Requested CPU Cores", "refId": "B", "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "CPU Cores", "tooltip": { + "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, @@ -4349,22 +4006,16 @@ data: "format": "short", "label": "CPU Cores", "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -4373,7 +4024,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -4382,8 +4033,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 2, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -4398,7 +4049,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -4417,7 +4067,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": true }, - "tableColumn": "", "targets": [ { "expr": "max(sum(kube_pod_container_resource_requests_cpu_cores) by (instance)) / min(sum(kube_node_status_allocatable_cpu_cores) by (instance)) * 100", @@ -4429,6 +4078,7 @@ data: ], "thresholds": "80, 90", "title": "CPU Cores", + "transparent": false, "type": "singlestat", "valueFontSize": "110%", "valueMaps": [ @@ -4441,16 +4091,14 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, "title": "CPU Cores", "titleSize": "h6" }, { "collapse": false, - "height": "300", + "editable": true, + "height": "300px", "panels": [ { "aliasColors": {}, @@ -4459,16 +4107,26 @@ data: "dashes": false, "datasource": "${DS_PROMETHEUS}", "description": "This represents the total [memory resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory) in the cluster.\nFor comparison the total [allocatable memory](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node-allocatable.md) is also shown.", + "editable": true, + "error": false, "fill": 1, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 3, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 1, @@ -4494,26 +4152,23 @@ data: }, { "expr": "max(sum(kube_pod_container_resource_requests_memory_bytes) by (instance))", + "hide": false, "intervalFactor": 2, "legendFormat": "Requested Memory", "refId": "B", "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "Memory", "tooltip": { + "msResolution": false, "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, @@ -4522,22 +4177,16 @@ data: "format": "bytes", "label": "Memory", "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -4546,7 +4195,7 @@ data: "rgba(245, 54, 54, 0.9)" ], "datasource": "${DS_PROMETHEUS}", - "decimals": null, + "editable": true, "format": "percent", "gauge": { "maxValue": 100, @@ -4555,8 +4204,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 4, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -4571,7 +4220,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -4590,7 +4238,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": true }, - "tableColumn": "", "targets": [ { "expr": "max(sum(kube_pod_container_resource_requests_memory_bytes) by (instance)) / min(sum(kube_node_status_allocatable_memory_bytes) by (instance)) * 100", @@ -4602,6 +4249,7 @@ data: ], "thresholds": "80, 90", "title": "Memory", + "transparent": false, "type": "singlestat", "valueFontSize": "110%", "valueMaps": [ @@ -4614,15 +4262,13 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, "title": "Memory", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -4660,7 +4306,8 @@ data: "timezone": "browser", "title": "Kubernetes Resource Requests", "version": 2 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -4677,38 +4324,12 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { @@ -4719,16 +4340,15 @@ data: "gnetId": 22, "graphTooltip": 0, "hideControls": false, - "id": null, "links": [], "refresh": false, "rows": [ { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -4737,16 +4357,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 3, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -4771,10 +4398,7 @@ data: "step": 50 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Idle cpu", + "title": "Idle CPU", "tooltip": { "msResolution": false, "shared": true, @@ -4783,9 +4407,7 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, @@ -4800,16 +4422,12 @@ data: }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -4818,16 +4436,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 9, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -4868,10 +4493,7 @@ data: "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "System load", + "title": "System Load", "tooltip": { "msResolution": false, "shared": true, @@ -4880,45 +4502,34 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "percentunit", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" }, { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -4927,8 +4538,12 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 4, + "isNew": false, "legend": { "alignAsTable": false, "avg": false, @@ -4939,8 +4554,7 @@ data: "min": false, "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -4997,10 +4611,7 @@ data: "step": 10 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Memory usage", + "title": "Memory Usage", "tooltip": { "msResolution": false, "shared": true, @@ -5009,33 +4620,25 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, "min": "0", "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -5045,7 +4648,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "percent", "gauge": { "maxValue": 100, @@ -5054,8 +4656,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 5, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -5070,7 +4672,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -5089,7 +4690,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "((node_memory_MemTotal{instance=\"$server\"} - node_memory_MemFree{instance=\"$server\"} - node_memory_Buffers{instance=\"$server\"} - node_memory_Cached{instance=\"$server\"}) / node_memory_MemTotal{instance=\"$server\"}) * 100", @@ -5100,7 +4700,8 @@ data: } ], "thresholds": "80, 90", - "title": "Memory usage", + "title": "Memory Usage", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -5113,19 +4714,16 @@ data: "valueName": "avg" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" }, { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -5134,16 +4732,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 6, + "isNew": true, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -5196,9 +4801,6 @@ data: "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "Disk I/O", "tooltip": { "msResolution": false, @@ -5208,33 +4810,24 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "ms", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ @@ -5244,7 +4837,6 @@ data: ], "datasource": "${DS_PROMETHEUS}", "editable": true, - "error": false, "format": "percentunit", "gauge": { "maxValue": 1, @@ -5253,8 +4845,8 @@ data: "thresholdLabels": false, "thresholdMarkers": true }, + "hideTimeOverride": false, "id": 7, - "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -5269,7 +4861,6 @@ data: ], "maxDataPoints": 100, "nullPointMode": "connected", - "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", @@ -5288,7 +4879,6 @@ data: "lineColor": "rgb(31, 120, 193)", "show": false }, - "tableColumn": "", "targets": [ { "expr": "(sum(node_filesystem_size{device!=\"rootfs\",instance=\"$server\"}) - sum(node_filesystem_free{device!=\"rootfs\",instance=\"$server\"})) / sum(node_filesystem_size{device!=\"rootfs\",instance=\"$server\"})", @@ -5299,7 +4889,8 @@ data: } ], "thresholds": "0.75, 0.9", - "title": "Disk space usage", + "title": "Disk Space Usage", + "transparent": false, "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ @@ -5312,19 +4903,16 @@ data: "valueName": "current" } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" }, { "collapse": false, + "editable": true, "height": "250px", "panels": [ { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -5333,16 +4921,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 8, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -5354,7 +4949,7 @@ data: "renderer": "flot", "seriesOverrides": [ { - "alias": "transmitted ", + "alias": "transmitted", "yaxis": 2 } ], @@ -5373,10 +4968,7 @@ data: "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network received", + "title": "Network Received", "tooltip": { "msResolution": false, "shared": true, @@ -5385,33 +4977,24 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] }, { - "alerting": {}, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -5420,16 +5003,23 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 10, + "isNew": false, "legend": { + "alignAsTable": false, "avg": false, "current": false, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, + "rightSide": false, "show": true, - "total": false, - "values": false + "total": false }, "lines": true, "linewidth": 2, @@ -5441,7 +5031,7 @@ data: "renderer": "flot", "seriesOverrides": [ { - "alias": "transmitted ", + "alias": "transmitted", "yaxis": 2 } ], @@ -5460,10 +5050,7 @@ data: "target": "" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Network transmitted", + "title": "Network Transmitted", "tooltip": { "msResolution": false, "shared": true, @@ -5472,41 +5059,31 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -5565,7 +5142,8 @@ data: "timezone": "browser", "title": "Nodes", "version": 2 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -5582,46 +5160,26 @@ data: { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "prometheus", "description": "", - "type": "datasource", + "label": "prometheus", + "name": "DS_PROMETHEUS", "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" + "pluginName": "Prometheus", + "type": "datasource" } ], "annotations": { "list": [] }, "editable": true, - "gnetId": null, "graphTooltip": 1, "hideControls": false, - "id": null, "links": [], + "refresh": false, "rows": [ { "collapse": false, + "editable": true, "height": "250px", "panels": [ { @@ -5633,12 +5191,18 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 1, + "isNew": false, "legend": { "alignAsTable": true, "avg": true, "current": true, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, "rightSide": true, @@ -5679,9 +5243,6 @@ data: "step": 20 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "Memory Usage", "tooltip": { "msResolution": true, @@ -5691,41 +5252,31 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, "title": "Row", "titleSize": "h6" }, { "collapse": false, + "editable": true, "height": "250px", "panels": [ { @@ -5737,12 +5288,18 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 2, + "isNew": false, "legend": { "alignAsTable": true, "avg": true, "current": true, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, "rightSide": true, @@ -5765,16 +5322,13 @@ data: "steppedLine": false, "targets": [ { - "expr": "sum by (container_name)( rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\",pod_name=\"$pod\"}[1m] ) )", + "expr": "sum by (container_name)(rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\",pod_name=\"$pod\"}[1m]))", "intervalFactor": 2, "legendFormat": "{{ container_name }}", "refId": "A", "step": 30 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "CPU Usage", "tooltip": { "msResolution": true, @@ -5784,41 +5338,31 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "Row", "titleSize": "h6" }, { "collapse": false, + "editable": true, "height": "250px", "panels": [ { @@ -5830,12 +5374,18 @@ data: "editable": true, "error": false, "fill": 1, - "grid": {}, + "grid": { + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, "id": 3, + "isNew": false, "legend": { "alignAsTable": true, "avg": true, "current": true, + "hideEmpty": false, + "hideZero": false, "max": false, "min": false, "rightSide": true, @@ -5858,16 +5408,13 @@ data: "steppedLine": false, "targets": [ { - "expr": "sort_desc(sum by (pod_name) (rate (container_network_receive_bytes_total{pod_name=\"$pod\"}[1m]) ))", + "expr": "sort_desc(sum by (pod_name) (rate(container_network_receive_bytes_total{pod_name=\"$pod\"}[1m])))", "intervalFactor": 2, "legendFormat": "{{ pod_name }}", "refId": "A", "step": 30 } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, "title": "Network I/O", "tooltip": { "msResolution": true, @@ -5877,41 +5424,31 @@ data: }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", - "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "bytes", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true }, { "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": true } ] } ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, "showTitle": false, - "title": "New row", + "title": "New Row", "titleSize": "h6" } ], "schemaVersion": 14, + "sharedCrosshair": false, "style": "dark", "tags": [], "templating": { @@ -6010,7 +5547,8 @@ data: "timezone": "browser", "title": "Pods", "version": 1 - } , + } + , "inputs": [ { "name": "DS_PROMETHEUS", @@ -6029,4 +5567,3 @@ data: "type": "prometheus", "url": "http://prometheus-k8s.monitoring.svc:9090" } ---- diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fdc2b200388fc3a7d1fc9f67c8e846aebff90d8b --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +git+https://github.com/aknuds1/grafanalib.git@v0.4.0 \ No newline at end of file