From bc814c9be6a6eea5c6279afa8cfdf87bc722248c Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 9 Jul 2021 11:21:06 -0400 Subject: [PATCH] new panels, add containers var, hide manint and monint var from dash --- salt/grafana/defaults.yaml | 7 +- salt/grafana/init.sls | 9 +- .../panels/cpu_docker_combined.json.jinja | 594 ------------------ .../cpu_docker_combined_current.json.jinja | 155 +++++ .../cpu_docker_combined_trend.json.jinja | 156 +++++ .../memory_used_docker_combined.json.jinja | 538 ---------------- ...ry_used_docker_combined_current.json.jinja | 149 +++++ ...mory_used_docker_combined_trend.json.jinja | 149 +++++ salt/grafana/templates/containers.json | 29 + salt/grafana/templates/cpucount.json | 2 +- salt/grafana/templates/manint.json | 2 +- salt/grafana/templates/monint.json | 2 +- 12 files changed, 647 insertions(+), 1145 deletions(-) delete mode 100644 salt/grafana/panels/cpu_docker_combined.json.jinja create mode 100644 salt/grafana/panels/cpu_docker_combined_current.json.jinja create mode 100644 salt/grafana/panels/cpu_docker_combined_trend.json.jinja delete mode 100644 salt/grafana/panels/memory_used_docker_combined.json.jinja create mode 100644 salt/grafana/panels/memory_used_docker_combined_current.json.jinja create mode 100644 salt/grafana/panels/memory_used_docker_combined_trend.json.jinja create mode 100644 salt/grafana/templates/containers.json diff --git a/salt/grafana/defaults.yaml b/salt/grafana/defaults.yaml index 7e016415a..81ae5e9a2 100644 --- a/salt/grafana/defaults.yaml +++ b/salt/grafana/defaults.yaml @@ -29,12 +29,15 @@ grafana: templating: list: - servername + - containers - manint - monint - cpucount panels: - cpu_docker_combined: {} - memory_used_docker_combined: {} + cpu_docker_combined_current: {} + cpu_docker_combined_trend: {} + memory_used_docker_combined_current: {} + memory_used_docker_combined_trend: {} # cpu_usage_idle: # enabled: true # trend: true diff --git a/salt/grafana/init.sls b/salt/grafana/init.sls index d481d55bf..777b7ca6d 100644 --- a/salt/grafana/init.sls +++ b/salt/grafana/init.sls @@ -114,11 +114,7 @@ grafana-config-files: - group: 939 - source: salt://grafana/etc/files - makedirs: True - -{% if salt['pillar.get']('standalonetab', False) %} -{% for SN, SNDATA in salt['pillar.get']('standalonetab', {}).items() %} -{% set NODETYPE = SN.split('_')|last %} -{% set SN = SN | regex_replace('_' ~ NODETYPE, '') %} + common-standalone-dashboard: file.managed: - name: /opt/so/conf/grafana/grafana_dashboards/standalone/common_standalone.json @@ -130,9 +126,6 @@ common-standalone-dashboard: UID: so_overview PANELS: {{GRAFANA_SETTINGS.dashboards.standalone.panels}} TEMPLATES: {{GRAFANA_SETTINGS.dashboards.standalone.templating.list}} -{% endfor %} -{% endif %} - so-grafana: docker_container.running: diff --git a/salt/grafana/panels/cpu_docker_combined.json.jinja b/salt/grafana/panels/cpu_docker_combined.json.jinja deleted file mode 100644 index 4c15920d2..000000000 --- a/salt/grafana/panels/cpu_docker_combined.json.jinja +++ /dev/null @@ -1,594 +0,0 @@ -{ - "type": "graph", - "title": "Container CPU Usage", - "gridPos": { - "x": 0, - "y": 0, - "w": 30, - "h": 10 - }, - "id": 1, - "targets": [ - { - "refId": "A", - "queryType": "randomWalk", - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-elasticsearch" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - " / $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "query": "SELECT mean(\"usage_percent\") / $cpucount FROM \"docker_container_cpu\" WHERE (\"host\" = '$servername' AND \"container_name\" = 'so-elasticsearch') AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": false, - "hide": false, - "alias": "elasticsearch" - }, - { - "refId": "B", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-filebeat" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - " / $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "alias": "filebeat" - }, - { - "refId": "C", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-influxdb" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - " / $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "alias": "influxdb" - }, - { - "refId": "D", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-logstash" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - " / $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "alias": "logstash" - }, - { - "refId": "E", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-zeek" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - "/ $cpucount " - ] - } - ] - ], - "alias": "zeek", - "measurement": "docker_container_cpu" - }, - { - "refId": "F", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-suricata" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "value" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - "/ $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "alias": "suricata" - }, - { - "refId": "G", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-steno" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - "/ $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "alias": "steno" - }, - { - "refId": "H", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-kibana" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - "/ $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "alias": "kibana" - }, - { - "refId": "I", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-redis" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - }, - { - "type": "math", - "params": [ - "/ $cpucount " - ] - } - ] - ], - "measurement": "docker_container_cpu", - "alias": "redis" - } - ], - "options": { - "alertThreshold": true - }, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "pluginVersion": "7.5.4", - "renderer": "flot", - "yaxes": [ - { - "label": null, - "show": true, - "logBase": 1, - "min": null, - "max": null, - "format": "short" - }, - { - "label": null, - "show": true, - "logBase": 1, - "min": null, - "max": null, - "format": "short" - } - ], - "xaxis": { - "show": true, - "mode": "time", - "name": null, - "values": [], - "buckets": null - }, - "yaxis": { - "align": false, - "alignLevel": null - }, - "lines": true, - "fill": 1, - "linewidth": 1, - "dashLength": 10, - "spaceLength": 10, - "pointradius": 2, - "legend": { - "show": true, - "values": false, - "min": false, - "max": false, - "current": false, - "total": false, - "avg": false - }, - "nullPointMode": "connected", - "tooltip": { - "value_type": "individual", - "shared": true, - "sort": 0 - }, - "aliasColors": {}, - "seriesOverrides": [], - "thresholds": [], - "timeRegions": [], - "fillGradient": 0, - "dashes": false, - "hiddenSeries": false, - "points": false, - "bars": false, - "stack": false, - "percentage": false, - "steppedLine": false, - "timeFrom": null, - "timeShift": null -} diff --git a/salt/grafana/panels/cpu_docker_combined_current.json.jinja b/salt/grafana/panels/cpu_docker_combined_current.json.jinja new file mode 100644 index 000000000..a2635f41a --- /dev/null +++ b/salt/grafana/panels/cpu_docker_combined_current.json.jinja @@ -0,0 +1,155 @@ +{ + "type": "graph", + "title": "Container CPU Usage Current", + "gridPos": { + "x": 0, + "y": 0, + "w": 24, + "h": 10 + }, + "id": 4, + "targets": [ + { + "refId": "A", + "queryType": "randomWalk", + "policy": "default", + "resultFormat": "time_series", + "orderByTime": "ASC", + "tags": [ + { + "key": "host", + "operator": "=~", + "value": "/^$servername$/" + }, + { + "condition": "AND", + "key": "container_name", + "operator": "=~", + "value": "/^$containers$/" + } + ], + "groupBy": [ + { + "type": "time", + "params": [ + "$__interval" + ] + }, + { + "type": "tag", + "params": [ + "container_name" + ] + }, + { + "type": "fill", + "params": [ + "null" + ] + } + ], + "select": [ + [ + { + "type": "field", + "params": [ + "usage_percent" + ] + }, + { + "type": "mean", + "params": [] + }, + { + "type": "math", + "params": [ + " / $cpucount" + ] + } + ] + ], + "measurement": "docker_container_cpu", + "alias": "$tag_container_name" + } + ], + "options": { + "alertThreshold": true + }, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "pluginVersion": "7.5.4", + "renderer": "flot", + "yaxes": [ + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "percent", + "$$hashKey": "object:315" + }, + { + "label": null, + "show": false, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:316" + } + ], + "xaxis": { + "show": true, + "mode": "time", + "name": null, + "values": [], + "buckets": null + }, + "yaxis": { + "align": false, + "alignLevel": null + }, + "lines": true, + "fill": 1, + "linewidth": 1, + "dashLength": 10, + "spaceLength": 10, + "pointradius": 2, + "legend": { + "show": true, + "values": false, + "min": false, + "max": false, + "current": false, + "total": false, + "avg": false, + "alignAsTable": false, + "rightSide": false, + "hideZero": false + }, + "nullPointMode": "connected", + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 0 + }, + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [], + "decimals": null, + "fillGradient": 0, + "dashes": false, + "hiddenSeries": false, + "points": false, + "bars": false, + "stack": false, + "percentage": false, + "steppedLine": false, + "timeFrom": null, + "timeShift": null +} diff --git a/salt/grafana/panels/cpu_docker_combined_trend.json.jinja b/salt/grafana/panels/cpu_docker_combined_trend.json.jinja new file mode 100644 index 000000000..9a2af38ce --- /dev/null +++ b/salt/grafana/panels/cpu_docker_combined_trend.json.jinja @@ -0,0 +1,156 @@ +{ + "type": "graph", + "title": "Container CPU Usage Trend", + "gridPos": { + "x": 0, + "y": 10, + "w": 24, + "h": 10 + }, + "id": 6, + "targets": [ + { + "refId": "A", + "queryType": "randomWalk", + "policy": "so_long_term", + "resultFormat": "time_series", + "orderByTime": "ASC", + "tags": [ + { + "key": "host", + "operator": "=~", + "value": "/^$servername$/" + }, + { + "condition": "AND", + "key": "container_name", + "operator": "=~", + "value": "/^$containers$/" + } + ], + "groupBy": [ + { + "type": "time", + "params": [ + "$__interval" + ] + }, + { + "type": "tag", + "params": [ + "container_name" + ] + }, + { + "type": "fill", + "params": [ + "null" + ] + } + ], + "select": [ + [ + { + "type": "field", + "params": [ + "mean_usage_percent" + ] + }, + { + "type": "mean", + "params": [] + }, + { + "type": "math", + "params": [ + " / $cpucount" + ] + } + ] + ], + "measurement": "docker_container_cpu", + "alias": "$tag_container_name" + } + ], + "options": { + "alertThreshold": true + }, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "pluginVersion": "7.5.4", + "renderer": "flot", + "yaxes": [ + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "percent", + "$$hashKey": "object:315" + }, + { + "label": null, + "show": false, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:316" + } + ], + "xaxis": { + "show": true, + "mode": "time", + "name": null, + "values": [], + "buckets": null + }, + "yaxis": { + "align": false, + "alignLevel": null + }, + "lines": true, + "fill": 1, + "linewidth": 1, + "dashLength": 10, + "spaceLength": 10, + "pointradius": 2, + "legend": { + "show": true, + "values": true, + "min": false, + "max": false, + "current": false, + "total": false, + "avg": true, + "alignAsTable": false, + "rightSide": false, + "hideZero": false + }, + "nullPointMode": "connected", + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 0 + }, + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [], + "decimals": 1, + "fillGradient": 0, + "dashes": false, + "hiddenSeries": false, + "points": false, + "bars": false, + "stack": false, + "percentage": false, + "steppedLine": false, + "timeFrom": null, + "timeShift": null, + "description": "" +} diff --git a/salt/grafana/panels/memory_used_docker_combined.json.jinja b/salt/grafana/panels/memory_used_docker_combined.json.jinja deleted file mode 100644 index 45a6eb62b..000000000 --- a/salt/grafana/panels/memory_used_docker_combined.json.jinja +++ /dev/null @@ -1,538 +0,0 @@ -{ - "type": "graph", - "title": "Container Memory Usage", - "gridPos": { - "x": 0, - "y": 10, - "w": 30, - "h": 10 - }, - "id": 2, - "targets": [ - { - "refId": "A", - "queryType": "randomWalk", - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-elasticsearch" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "hide": false, - "alias": "elasticsearch" - }, - { - "refId": "B", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-filebeat" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "alias": "filebeat" - }, - { - "refId": "C", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-influxdb" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "alias": "influxdb" - }, - { - "refId": "D", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-logstash" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "alias": "logstash" - }, - { - "refId": "E", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-zeek" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "alias": "zeek", - "measurement": "docker_container_mem" - }, - { - "refId": "F", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-suricata" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "value" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "alias": "suricata" - }, - { - "refId": "G", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-steno" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "alias": "steno" - }, - { - "refId": "H", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-kibana" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "alias": "kibana" - }, - { - "refId": "I", - "hide": false, - "policy": "default", - "resultFormat": "time_series", - "orderByTime": "ASC", - "tags": [ - { - "key": "host", - "operator": "=", - "value": "$servername" - }, - { - "condition": "AND", - "key": "container_name", - "operator": "=", - "value": "so-redis" - } - ], - "groupBy": [ - { - "type": "time", - "params": [ - "$__interval" - ] - }, - { - "type": "fill", - "params": [ - "null" - ] - } - ], - "select": [ - [ - { - "type": "field", - "params": [ - "usage_percent" - ] - }, - { - "type": "mean", - "params": [] - } - ] - ], - "measurement": "docker_container_mem", - "alias": "redis" - } - ], - "options": { - "alertThreshold": true - }, - "datasource": "InfluxDB", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "pluginVersion": "7.5.4", - "renderer": "flot", - "yaxes": [ - { - "label": null, - "show": true, - "logBase": 1, - "min": null, - "max": null, - "format": "short" - }, - { - "label": null, - "show": true, - "logBase": 1, - "min": null, - "max": null, - "format": "short" - } - ], - "xaxis": { - "show": true, - "mode": "time", - "name": null, - "values": [], - "buckets": null - }, - "yaxis": { - "align": false, - "alignLevel": null - }, - "lines": true, - "fill": 1, - "linewidth": 1, - "dashLength": 10, - "spaceLength": 10, - "pointradius": 2, - "legend": { - "show": true, - "values": false, - "min": false, - "max": false, - "current": false, - "total": false, - "avg": false - }, - "nullPointMode": "connected", - "tooltip": { - "value_type": "individual", - "shared": true, - "sort": 0 - }, - "aliasColors": {}, - "seriesOverrides": [], - "thresholds": [], - "timeRegions": [], - "fillGradient": 0, - "dashes": false, - "hiddenSeries": false, - "points": false, - "bars": false, - "stack": false, - "percentage": false, - "steppedLine": false, - "timeFrom": null, - "timeShift": null -} diff --git a/salt/grafana/panels/memory_used_docker_combined_current.json.jinja b/salt/grafana/panels/memory_used_docker_combined_current.json.jinja new file mode 100644 index 000000000..6e9df41fb --- /dev/null +++ b/salt/grafana/panels/memory_used_docker_combined_current.json.jinja @@ -0,0 +1,149 @@ +{ + "type": "graph", + "title": "Container Memory Usage Current", + "gridPos": { + "x": 0, + "y": 20, + "w": 24, + "h": 10 + }, + "id": 5, + "targets": [ + { + "refId": "A", + "queryType": "randomWalk", + "policy": "default", + "resultFormat": "time_series", + "orderByTime": "ASC", + "tags": [ + { + "key": "host", + "operator": "=~", + "value": "/^$servername$/" + }, + { + "condition": "AND", + "key": "container_name", + "operator": "=~", + "value": "/^$containers$/" + } + ], + "groupBy": [ + { + "type": "time", + "params": [ + "$__interval" + ] + }, + { + "type": "tag", + "params": [ + "container_name" + ] + }, + { + "type": "fill", + "params": [ + "null" + ] + } + ], + "select": [ + [ + { + "type": "field", + "params": [ + "usage_percent" + ] + }, + { + "type": "mean", + "params": [] + } + ] + ], + "measurement": "docker_container_mem", + "alias": "$tag_container_name" + } + ], + "options": { + "alertThreshold": true + }, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "pluginVersion": "7.5.4", + "renderer": "flot", + "yaxes": [ + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "percent", + "$$hashKey": "object:315" + }, + { + "label": null, + "show": false, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:316" + } + ], + "xaxis": { + "show": true, + "mode": "time", + "name": null, + "values": [], + "buckets": null + }, + "yaxis": { + "align": false, + "alignLevel": null + }, + "lines": true, + "fill": 1, + "linewidth": 1, + "dashLength": 10, + "spaceLength": 10, + "pointradius": 2, + "legend": { + "show": true, + "values": false, + "min": false, + "max": false, + "current": false, + "total": false, + "avg": false, + "alignAsTable": false, + "rightSide": false, + "hideZero": false + }, + "nullPointMode": "connected", + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 0 + }, + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [], + "decimals": null, + "fillGradient": 0, + "dashes": false, + "hiddenSeries": false, + "points": false, + "bars": false, + "stack": false, + "percentage": false, + "steppedLine": false, + "timeFrom": null, + "timeShift": null +} diff --git a/salt/grafana/panels/memory_used_docker_combined_trend.json.jinja b/salt/grafana/panels/memory_used_docker_combined_trend.json.jinja new file mode 100644 index 000000000..ddbbafe28 --- /dev/null +++ b/salt/grafana/panels/memory_used_docker_combined_trend.json.jinja @@ -0,0 +1,149 @@ +{ + "type": "graph", + "title": "Container Memory Usage Trend", + "gridPos": { + "x": 0, + "y": 30, + "w": 24, + "h": 10 + }, + "id": 7, + "targets": [ + { + "refId": "A", + "queryType": "randomWalk", + "policy": "so_long_term", + "resultFormat": "time_series", + "orderByTime": "ASC", + "tags": [ + { + "key": "host", + "operator": "=~", + "value": "/^$servername$/" + }, + { + "condition": "AND", + "key": "container_name", + "operator": "=~", + "value": "/^$containers$/" + } + ], + "groupBy": [ + { + "type": "time", + "params": [ + "$__interval" + ] + }, + { + "type": "tag", + "params": [ + "container_name" + ] + }, + { + "type": "fill", + "params": [ + "null" + ] + } + ], + "select": [ + [ + { + "type": "field", + "params": [ + "mean_usage_percent" + ] + }, + { + "type": "mean", + "params": [] + } + ] + ], + "measurement": "docker_container_mem", + "alias": "$tag_container_name" + } + ], + "options": { + "alertThreshold": true + }, + "datasource": "InfluxDB", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "pluginVersion": "7.5.4", + "renderer": "flot", + "yaxes": [ + { + "label": null, + "show": true, + "logBase": 1, + "min": null, + "max": null, + "format": "percent", + "$$hashKey": "object:315" + }, + { + "label": null, + "show": false, + "logBase": 1, + "min": null, + "max": null, + "format": "short", + "$$hashKey": "object:316" + } + ], + "xaxis": { + "show": true, + "mode": "time", + "name": null, + "values": [], + "buckets": null + }, + "yaxis": { + "align": false, + "alignLevel": null + }, + "lines": true, + "fill": 1, + "linewidth": 1, + "dashLength": 10, + "spaceLength": 10, + "pointradius": 2, + "legend": { + "show": true, + "values": true, + "min": false, + "max": false, + "current": false, + "total": false, + "avg": true, + "alignAsTable": false, + "rightSide": false, + "hideZero": false + }, + "nullPointMode": "connected", + "tooltip": { + "value_type": "individual", + "shared": true, + "sort": 0 + }, + "aliasColors": {}, + "seriesOverrides": [], + "thresholds": [], + "timeRegions": [], + "decimals": 1, + "fillGradient": 0, + "dashes": false, + "hiddenSeries": false, + "points": false, + "bars": false, + "stack": false, + "percentage": false, + "steppedLine": false, + "timeFrom": null, + "timeShift": null +} diff --git a/salt/grafana/templates/containers.json b/salt/grafana/templates/containers.json new file mode 100644 index 000000000..9cecddf8e --- /dev/null +++ b/salt/grafana/templates/containers.json @@ -0,0 +1,29 @@ +{ + "allValue": null, + "current": { + "selected": true, + "tags": [], + "text": [], + "value": [] + }, + "datasource": "InfluxDB", + "definition": "SHOW TAG VALUES ON telegraf WITH KEY = container_name WHERE (_name = 'docker_container_cpu') AND ((host = '$servername') AND (_tagKey = 'container_name'))", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Docker Containers", + "multi": true, + "name": "containers", + "options": [], + "query": "SHOW TAG VALUES ON telegraf WITH KEY = container_name WHERE (_name = 'docker_container_cpu') AND ((host = '$servername') AND (_tagKey = 'container_name'))", + "refresh": 1, + "regex": "/so-*/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } diff --git a/salt/grafana/templates/cpucount.json b/salt/grafana/templates/cpucount.json index 08294aa2e..202ae7a49 100644 --- a/salt/grafana/templates/cpucount.json +++ b/salt/grafana/templates/cpucount.json @@ -5,7 +5,7 @@ "definition": "SELECT \"n_cpus\" FROM \"system\" WHERE \"host\" = '$servername'", "description": null, "error": null, - "hide": 0, + "hide": 2, "includeAll": false, "label": "CPU Count", "multi": false, diff --git a/salt/grafana/templates/manint.json b/salt/grafana/templates/manint.json index 8c0e65530..e1578b3d7 100644 --- a/salt/grafana/templates/manint.json +++ b/salt/grafana/templates/manint.json @@ -5,7 +5,7 @@ "definition": "SELECT \"manint\" FROM \"node_config\" WHERE (\"host\" = '$servername')", "description": null, "error": null, - "hide": 0, + "hide": 2, "includeAll": false, "label": "Management Interface", "multi": false, diff --git a/salt/grafana/templates/monint.json b/salt/grafana/templates/monint.json index 98098467f..68ceec062 100644 --- a/salt/grafana/templates/monint.json +++ b/salt/grafana/templates/monint.json @@ -5,7 +5,7 @@ "definition": "SELECT \"monint\" FROM \"node_config\" WHERE (\"host\" = '$servername')", "description": null, "error": null, - "hide": 0, + "hide": 2, "includeAll": false, "label": "Monitor Interface", "multi": false,