Advanced Dashboard Features¶
Grafana dashboards can be extended with dynamic variables, contextual navigation via row links, and custom alerting rules to enhance observability workflows. These features enable tailored monitoring experiences, reduce manual configuration, and improve incident response efficiency.
Variables for Dynamic Filtering¶
Variables allow users to interact with dashboards by filtering data dynamically. They are especially useful for selecting specific services, environments, or time ranges.
Example: Service Dropdown Variable¶
Variable Types¶
- Constant: Fixed values (e.g.,
prod,staging) - Query: Dynamic values from Prometheus (e.g., service names)
- Regex: Pattern-based filtering (e.g.,
prod-.*)
Usage in Panels¶
Use variables in queries by prefixing them with $ (e.g., http_requests_total{job="$job"}).
Row Links for Contextual Navigation¶
Row links let users jump between panels or external resources based on data in a row. This is ideal for drilling down into specific metrics or triggering workflows.
Example: Link to Service Metrics¶
Link Types¶
- Absolute: Direct URL to another dashboard or external site
- Relative: Navigate within the same dashboard
- Regex: Match patterns in row data to construct URLs
Configuration¶
- Edit a row → "Row link" → Select link type
- Use
$-prefixed variables in the URL
Dashboard-Specific Alerting Rules¶
Alerting rules tied to a dashboard ensure metrics relevant to that view are monitored. These rules can trigger notifications via Slack, email, or PagerDuty.
Example: High Latency Alert¶
- alert: HighLatency
expr: avg_over_time(http_request_latency_seconds{job="$job"}[5m]) > 0.5
for: 5m
labels:
severity: warning
annotations:
summary: "High latency in {{ $labels.job }}"
description: "Average latency exceeds 0.5s"
Configuration Steps¶
- Open dashboard → "Alerting" tab
- Add a new rule → Select "Dashboard" as the rule scope
- Define conditions, thresholds, and notification channels
Key takeaways¶
- Variables make dashboards reusable by dynamically filtering data.
- Row links enable seamless navigation between related metrics or external systems.
- Dashboard-specific alerts ensure critical metrics are monitored without polluting global alerting configurations.