Commit d72bb0c4 authored by rpereira2's avatar rpereira2

Add an instance variable to self monitoring dashboard

Add an instance variable that allows users to filter the resource
usage charts by the instance label.
parent f0abb5aa
---
title: Add ability to filter self monitoring resource usage charts by instance name
merge_request: 34084
author:
type: changed
dashboard: 'Default dashboard' dashboard: 'Default dashboard'
priority: 1 priority: 1
templating:
variables:
instance:
type: 'text'
label: 'Instance label regex'
options:
default_value: '.+'
panel_groups: panel_groups:
- group: 'Resource usage' - group: 'Resource usage'
...@@ -9,7 +18,7 @@ panel_groups: ...@@ -9,7 +18,7 @@ panel_groups:
y_label: "% memory used" y_label: "% memory used"
metrics: metrics:
- id: node_memory_usage_percentage - id: node_memory_usage_percentage
query_range: '(1 - (node_memory_MemAvailable_bytes or node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes + node_memory_Slab_bytes) / node_memory_MemTotal_bytes) * 100' query_range: '(1 - (node_memory_MemAvailable_bytes{instance=~"{{instance}}"} or (node_memory_MemFree_bytes{instance=~"{{instance}}"} + node_memory_Buffers_bytes{instance=~"{{instance}}"} + node_memory_Cached_bytes{instance=~"{{instance}}"} + node_memory_Slab_bytes{instance=~"{{instance}}"})) / node_memory_MemTotal_bytes{instance=~"{{instance}}"}) * 100'
unit: "%" unit: "%"
label: instance label: instance
...@@ -18,7 +27,7 @@ panel_groups: ...@@ -18,7 +27,7 @@ panel_groups:
y_label: "% CPU used" y_label: "% CPU used"
metrics: metrics:
- id: node_cpu_usage_percentage - id: node_cpu_usage_percentage
query_range: '(avg without (mode,cpu) (1 - irate(node_cpu_seconds_total{mode="idle"}[5m]))) * 100' query_range: '(avg without (mode,cpu) (1 - irate(node_cpu_seconds_total{mode="idle",instance=~"{{instance}}"}[5m]))) * 100'
unit: "%" unit: "%"
label: instance label: instance
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment