GitHub user jsk1004ha created a discussion: Query inspector for dashboard 
charts (SQL, response, and execution stats)

## Problem

When a dashboard chart returns unexpected data or is slower than expected, 
troubleshooting is split across separate actions. “View query” shows generated 
SQL and “View as table” shows the tabular result, but there is no single place 
to inspect the cached chart response and basic execution statistics.

Grafana’s [panel 
inspector](https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/panel-inspector/)
 provides a useful precedent: it groups query details, response data, and 
statistics so a user can debug a panel without leaving the dashboard.

## Proposed Superset MVP

Enhance the existing dashboard “View query” modal into a “Query inspector” with:

- **Query** — preserve the current generated-SQL behavior.
- **Response** — display and copy the chart's cached `queriesResponse` as 
formatted JSON, without issuing another data query.
- **Stats** — show query count, returned payload rows, cached-query count, 
serialized response size, and chart update duration.

The existing “View as table” action remains unchanged and continues to be the 
user-friendly data view. The Response tab is intended for debugging the actual 
chart-data payload.

## Permissions

The inspector should preserve existing permission boundaries:

- Users with `can_view_query` can access generated SQL and non-sensitive 
aggregate stats.
- Raw response JSON is only shown when the user can already explore the chart 
or use “View as table”.

## Implementation notes

- Reuse the `queriesResponse`, `chartUpdateStartTime`, and `chartUpdateEndTime` 
already stored in the dashboard chart state.
- Do not repeat the chart data request to populate Response or Stats.
- Keep the existing query-generation request and error handling unchanged.
- Add focused React Testing Library coverage for stats and permission-aware 
response visibility.

Would this be a useful direction for consolidating dashboard chart 
troubleshooting? A first implementation is ready and intentionally limits scope 
to cached response data and metrics Superset already records.


GitHub link: https://github.com/apache/superset/discussions/43375

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to