-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Description
Description
The get_dashboard_panel_queries tool only returns panels that use Prometheus/Loki-style queries. Panels using other datasource types (CloudWatch, Elasticsearch, etc.) are silently omitted from the results.
Root Cause
In tools/dashboard.go around line 320, the query extraction only checks for the expr field:
expr, _ := target["expr"].(string)
if expr != "" {
result = append(result, panelQuery{
Title: title,
Query: expr,
Datasource: datasourceInfo,
})
}Since expr is specific to Prometheus/Loki targets, any panel using a different datasource type gets skipped. For example:
- CloudWatch targets use
namespace,metricName,dimensions,statistic,region - Elasticsearch targets use
query,metrics,bucketAggs - Other datasource types have their own query structures
Steps to Reproduce
- Create a dashboard with a mix of Prometheus and CloudWatch panels
- Call
get_dashboard_panel_querieswith the dashboard UID - Only Prometheus panels are returned; CloudWatch panels are missing
Expected Behavior
All panels should be returned regardless of datasource type, with a normalized or datasource-appropriate query representation.
Suggestion
The tool could:
- Check for
expr(Prometheus/Loki) - Fall back to other common query fields like
query(Elasticsearch), or build a summary from structured fields (namespace/metricNamefor CloudWatch) - As a last resort, include the panel with a serialized representation of its targets so it's at least visible in the results rather than silently dropped
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels