Paneldump is a Grafana app plugin that exports raw metrics from a panel. The idea being that we want to be able to extract real data to serve as a baseline for alerts, rather than use a synthetic data generation language (like promtool).
Metrics are exported in prometheus text exposition format, with timestamps.
Yes, but it downloads the panel data after it's been processed. Meaning, if you are operating on the raw metrics, you will get the result of those operations. This is undesireable in the context of unit testing alerts - one wants to execute the alert query on the raw data and assert on its output.
- The user presses 'Export panel data' from a panel's context menu.
- The user gets redirected to
paneldumps's page, which will be filled in with the information of the dashboard, panel and selected time range. - The plugin extracts the query/queries of the panel, and send them to the plugin's go backend.
- The backend fills in Grafana macros with placedolders (think
$__interval->1m) - The backend extracts the metric names that are present in the query, sending these back to the frontend
- The fronted uses Grafana's HTTP datasource API to query prometheus for the requested metrics.
- Some chatGPT generated code converts it from Grafana/Prometheus response format into text exposition format.
Look into instant / interval query shenanigans, ensure we are getting correct results.
Integrate with eph
Consider storing in prometheus remote_write format.
Fork promtool and modify it to support reading metrics from file when unit testing alert rules.
Clean up the code. It was put together in 1 day.
See the original Grafana template dev instructions here


