mahendrapaipuri / grafana-dashboard-reporter-app

A Grafana plugin app to create PDF reports of dashboards
Apache License 2.0
29 stars 4 forks source link

Report repeated Paneld / collapsed Rows #11

Closed n3k232 closed 1 month ago

n3k232 commented 3 months ago

Hi,

first things first, great Work!

but i got two questions, is there a way to achieve that repeated Panels are also Reported?

and point 2: I noticed that Rows are only hidden in the Report if the Dashboard is saved with this state, is that behaviour wanted or is there a way to tell the Reporter to Collapse the Rows while Calling the plugin?

mahendrapaipuri commented 3 months ago

first things first, great Work!

Cheers. Appreciate your interest and feedback

but i got two questions, is there a way to achieve that repeated Panels are also Reported?

We never had to use repeated panels or rows, so, I dont have an immediate to your question. I will look into it and let you know. Would be great to support repeated panels and rows. Cheers for the pointer!

I noticed that Rows are only hidden in the Report if the Dashboard is saved with this state, is that behaviour wanted or is there a way to tell the Reporter to Collapse the Rows while Calling the plugin?

That is sort of intended behaviour. When using dashboardMode=default, report will be generated as it is saved (behind the scenes, plugin makes a API call to get dashboard's JSON model to generate report). When using dashboardMode=full, all the panels will be included in the report. This works for our cases. But, I see there is a room for improvement here. What we can think is to expose a query parameter that takes panel IDs as input and include only these in the report when provided. Do you think a solution like that would work for your use case?

e-donk commented 2 months ago

Hello there, just wondering if you've made any progress on the subject of reporting repeated panels ?

mahendrapaipuri commented 2 months ago

@e-donk Well, yes, I did look into it. The thing with repeated panels is these panels are created dynamically on the browser side. The ways reporter works is that it creates the reports by making a request to Grafana API server to fetch the last "saved" dashboard's JSON model and the Grafana server has no idea of current JSON model of the dashboard with repeated panels.

A workaround is that you will need to save the dashboard with repeated panels before generating the report. This should work although I havent tested it myself. But the downside is that the user needs to have appropriate role and permissions to be able to save the dashboard which might not work for all use cases. I will include this in the docs but yes, this is a limitation of the reporter app.

mahendrapaipuri commented 1 month ago

@n3k232 @e-donk PR #33 adds support for repeated panels and/or rows. You can download the plugin artifiacts from CI if you are interested in testing.