Grafana Mixed Data Sources Panel Prompt
Build panels combining multiple data sources — Mixed DS, cross-DS variables, correlated queries from Prometheus + Loki + cloud metrics.
- Target user
- Engineers building cross-DS dashboards
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior SRE who has built panels combining metrics from different sources — Prometheus + CloudWatch in one panel, Loki + Prometheus correlated. I will provide: - The DS combination - Use case - Current panel - Symptom Your job: 1. **Mixed DS panel**: - Select "Mixed" as DS - Each query picks its source - Combine in display 2. **For unit alignment**: - Different sources may have different units - Override per series 3. **For time alignment**: - Each DS may aggregate differently - Use `$__interval` consistently 4. **For correlated queries**: - Common time range - Common variable (env, region) 5. **For Prometheus + CloudWatch**: - Hybrid on-prem + cloud - Same panel 6. **For Prometheus + Loki**: - Metric series + log count - In single panel 7. **For variable scope**: - DS variable selects which - Conditional panel based on variable 8. **For panel performance**: - Multiple DS = compound query time Mark DESTRUCTIVE: cross-DS panel with vastly different scrape rates (misaligned), DS variable change breaking panels. --- DS combination: [DESCRIBE] Use case: [DESCRIBE] Symptom: [DESCRIBE]
Why this prompt works
Mixed DS enables cross-system views. This prompt walks design.
How to use it
- Use Mixed DS for the panel.
- Align time + variable.
- Watch performance.
- Test DS variable changes.
Patterns
Mixed DS panel
{
"type": "timeseries",
"datasource": "-- Mixed --",
"targets": [
{
"datasource": { "uid": "prometheus" },
"expr": "sum(rate(http_requests_total[5m]))",
"legendFormat": "On-prem RPS"
},
{
"datasource": { "uid": "cloudwatch" },
"namespace": "AWS/ApplicationELB",
"metricName": "RequestCount",
"statistic": "Sum",
"legendFormat": "AWS ELB RPS"
}
]
}
Prometheus + Loki log count
{
"type": "timeseries",
"datasource": "-- Mixed --",
"targets": [
{
"datasource": { "uid": "prometheus" },
"expr": "rate(http_requests_total{job=\"$job\"}[$__interval])",
"legendFormat": "Requests"
},
{
"datasource": { "uid": "loki" },
"expr": "sum(rate({job=\"$job\"} |= \"error\" [$__interval]))",
"legendFormat": "Errors (log)"
}
]
}
DS variable
Variable: $ds
Type: datasource
Type filter: prometheus
# Use in panel:
datasource: $ds
User picks DS at dashboard top; all panels switch.
Common findings this catches
- Panel slow → multiple DS each query.
- Series visible but wrong scale → unit mismatch.
- Time alignment off → step / interval mismatch.
- DS variable doesn’t apply to all → check panels.
- Cloud DS rate limit → reduce query frequency.
- Auth fail on one DS → token; per-DS auth.
- Series naming collision → use legend format.
When to escalate
- Cross-DS pattern across many dashboards — design review.
- Cloud DS cost — finops.
- Auth strategy — security.
Related prompts
-
Grafana Dashboard Performance Prompt
Optimize Grafana dashboards — query parallelism, refresh rates, variable design, panel count, data source pressure.
-
Grafana Loki + Prometheus Correlation Prompt
Correlate metrics and logs in Grafana — exemplars from Prometheus to traces, derived fields from Loki, jump from spike to log line.
-
Grafana Templating & Variables Design Prompt
Design Grafana variables — query variables, custom, interval, chained, multi-value, regex; debug missing values, slow load.