6.03L Dynamic panels based on variables - MartinWong06/grafana GitHub Wiki
-
Create a new dashboard, click on the gear button and got to variables tab. Click on add new variable
-
Provide the following details
-
Name - variable name using in promql
-
label - This Label will show on the Dashboard, you have the option select Label and value, value or nothing
-
Description - Description of the variable
-
Query Options
-
Data sources - Select Prometheus
-
Query - Input the query that you would like to use in variable
- Query Type - Label values
- Label - name
- Metrics - container_memory_usage_bytes
-
Regex - using regex further filter the variable result
-
Select Options
- check on "Multi Value"
- Check on "Include All Options"
Preview of values - Show query result values.
Example:
-
Add row on the dashboard
-
Click on the row cluster button then configure as below example to use the variable
-
Add the panel under the first row, develop your panel with the variable.
-
You may using following query PromQL
container_memory_usage_bytes{job="cadvisor",name=~"$container.*"}