How to query grafana panels data?

I have got large grafana dashobard with a lot of panels. Now i want to export panels data into database. Before inserting into database, transform from json.

What api should i request in grafana to receive dashboard data? Grafana 11.1.1

result of the api execution should be number of points in time, so i can draw diagrams

There’s a big difference between exporting dashboards and exporting the data
they display.

Grafana does the dashboards; it doesn’t store the data.

It’s your back-end data sources where the data is stored - that’s what you
need to query to get the data.

Grafana can only output the design / layout of the dashboards and panels, and
the queries they use to fetch data for display.

I hope that helps to clarify.

Antony.

what is the end goal of this effort of copying the dashboard json into a db? will this serve as backup of some sort or migration?

Thank you for replaying.
I configured sophisticated queries in my panels, with transformations.
Victoria Metrics is a data source for metrics.

As i already configured panels, it would be prefferable to use already configured queries.
If query is changed in grafana, i want changes to reflect in one place

Can you help me with api to use? I cannot find in documentation

My managers dont like Grafana UI.
They have got their own UI - called Power BI platform. This platform stores data in sql tables. Data can be consumed from other places with teh help of ETL
And they want to see grafana panels data in Power BI, not Grafana UI

Hi, I don’t think there’s an api for that. You can query datasource but not the panel, as you most probably require the web browser to display the data.

[Image renderer plugin](grafana-image-renderer/src/service/http-server.ts at b7d13e0df68d7c290414b949921b3b04449b813e · grafana/grafana-image-renderer · GitHub) has a render CSV method but truth be told I’ve never used that. It sounds like something that might help you.

If not, maybe this script (it’s a bit messy but I developed it for my masters thesis) might be somewhat a guide on how to get the CSV of the data - I remember it didn’t always work but I worked enough in my case :slight_smile:

1 Like