Skip to content

test: Add integration test for non-Prometheus panel query extraction#586

Draft
nullren wants to merge 1 commit intografana:mainfrom
nullren:test/panel-queries-non-prometheus-datasources
Draft

test: Add integration test for non-Prometheus panel query extraction#586
nullren wants to merge 1 commit intografana:mainfrom
nullren:test/panel-queries-non-prometheus-datasources

Conversation

@nullren
Copy link
Contributor

@nullren nullren commented Feb 20, 2026

Summary

  • Adds an integration test that creates a dashboard with CloudWatch, Elasticsearch, and Prometheus panels
  • Validates that GetDashboardPanelQueriesTool returns queries for all three datasource types
  • This test currently fails because the extraction logic only checks for the expr field (Prometheus/Loki), silently dropping panels using other datasource types

Related

Test plan

  • Run go test -tags integration ./tools/ -run TestGetDashboardPanelQueries_NonPrometheusDatasources against a local Grafana instance
  • Confirm the test fails, demonstrating the bug: only the Prometheus panel is returned while CloudWatch and Elasticsearch panels are omitted

🤖 Generated with Claude Code


Note

Low Risk
Test-only change gated behind the integration build tag; no production logic is modified (main risk is adding a failing CI test if integration tests are run).

Overview
Adds a new integration-tagged test (TestGetDashboardPanelQueries_NonPrometheusDatasources) that provisions a dashboard containing CloudWatch, Elasticsearch, and Prometheus panels, then asserts GetDashboardPanelQueriesTool returns queries for all datasource types.

The test currently documents the known bug that non-Prometheus panels are silently omitted (extraction only checks targets[].expr), so it will fail until the underlying query-extraction logic is expanded.

Written by Cursor Bugbot for commit b384a10. This will update automatically on new commits. Configure here.

Adds a test that creates a dashboard with CloudWatch, Elasticsearch,
and Prometheus panels, then validates that GetDashboardPanelQueriesTool
returns queries for all three. Currently, only Prometheus panels are
returned because the extraction logic only checks for the 'expr' field.

This test documents the bug described in grafana#585.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@nullren nullren requested a review from a team as a code owner February 20, 2026 00:36
@nullren nullren marked this pull request as draft February 20, 2026 00:36
@sd2k
Copy link
Collaborator

sd2k commented Feb 23, 2026

I think #539 might already kind of address this, although the test is certainly helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_dashboard_panel_queries omits non-Prometheus panels (CloudWatch, Elasticsearch, etc.)

2 participants