Skip to content

Grafana dashboard missing server dropdown (Helm deployment on AWS EKS)

0

We have deployed Prometheus and Grafana via Helm in an AWS EKS cluster. Dashboards are provisioned from JSON definitions using:

helm template . > grafana_dashboards.yaml kubectl apply -f grafana_dashboards.yaml

The dashboards load in Grafana, but the server/instance dropdown filter is missing at the top of the dashboard.

I checked the JSON files under dashboard_definitions, and they do not contain a templating.list section. From Grafana docs, a variable like the following is needed:

"templating": { "list": [ { "name": "instance", "label": "Server", "type": "query", "datasource": "Prometheus", "definition": "label_values(up{job=~"node-exporter|custom_exporter"}, instance)", "refresh": 2 } ] }

Questions:

  1. Do we need to manually add this templating.list section into our dashboard JSON before applying via Helm?
  2. Is there a way to inject such dropdown variables into dashboards via Helm values.yaml (without modifying JSON directly)?
  3. What is the best practice to manage custom dashboard variables in Grafana on AWS EKS?
1 Answer
0

Based on the information provided, here's what you need to know about adding server/instance dropdown filters to your Grafana dashboards:

  1. Yes, you do need to manually add the templating.list section to your dashboard JSON files before applying them via Helm. Variables are not automatically created - they must be defined in the dashboard JSON. The templating.list section you provided is the correct approach for adding a server/instance dropdown variable.

  2. There isn't a direct way to inject dropdown variables into dashboards via Helm values.yaml without modifying the JSON. Helm templates can be used to generate the dashboard JSON with the required templating sections, but this would still involve modifying your templates to include the variable definitions.

  3. Best practices for managing custom dashboard variables in Grafana on AWS EKS include:

  • Make your dashboards portable by adding template variables for values like metric prefixes (using constant variables) and server names
  • When exporting dashboards for others to use, include template variables for common elements that might change across environments
  • Use variables to create single-source dashboards that can be reused across multiple identical data sources or servers
  • Consider using constant variables for values that should be hidden in the dashboard but required during import
  • Organize related dashboards in folders for better management

Variables are essential for creating interactive and dynamic dashboards, allowing users to adjust visualizations without needing full editing permissions. They're displayed as dropdown lists at the top of the dashboard and are particularly useful when you have multiple identical data sources or servers that you want to monitor with a single dashboard.
Sources
Adding and managing dashboard variables - Amazon Managed Grafana
Exporting and importing dashboards - Amazon Managed Grafana
Managing dashboards - Amazon Managed Grafana
Dashboard JSON model - Amazon Managed Grafana

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.