reporter icon indicating copy to clipboard operation
reporter copied to clipboard

Add option to expand Collapsed panels in pdf

Open knockingOn opened this issue 5 years ago • 15 comments

The collapsed panels containing multiple graphs are not captured in the pdf report. Only expanded ones are being captured am i doing something wrong?

knockingOn avatar May 07 '19 09:05 knockingOn

Hmm this could either be a bug in the reporter or an artifact of the way the Grafana API responds to dashboard requests. The reporter requests the dashboard JSON from Grafana and iterates over all the panels, downloading them and then adding them to a structure to render the LaTeX doc. This issue will require investigating that interaction.

IzakMarais avatar May 07 '19 10:05 IzakMarais

Is there any way in Grafana where i can specify all panels to be expanded while the dashboard loads up? although this question is little bit off topic.. but asking for the help anyway.. since you seem to be familiar with Grafana as well. Thank You

knockingOn avatar May 08 '19 09:05 knockingOn

I think if you save the dashboard with all the panels expanded that should work.


From: knockingOn [email protected] Sent: Wednesday, 08 May 2019 11:58 To: IzakMarais/reporter Cc: Izak Marais; Comment Subject: Re: [IzakMarais/reporter] Collapsed panels not captured in pdf (#124)

Is there any way in Grafana where i can specify all panels to be expanded while the dashboard loads up? although this question is little bit off topic.. but asking for the help anyway.. since you seem to be familiar with Grafana as well. Thank You

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

IzakMarais avatar May 08 '19 14:05 IzakMarais

Any feedback on whether saving the dashboard with panels expanded solves this problem?

IzakMarais avatar Jul 18 '19 08:07 IzakMarais

@IzakMarais We are facing the same issue. A workaround is indeed to save the dashboard JSON with all panels expanded, but it's not a good solution overall. Any chance for a fix?

amirmalka avatar Dec 04 '19 15:12 amirmalka

From a quick look at the dashboard JSON returned for collapsed panels, it seems like all the needed information is still there. The conclusion is that this is a bug in the reporter.

IzakMarais avatar Dec 10 '19 07:12 IzakMarais

@IzakMarais Thanks for the prompt response! Do you think it will be fixed anytime soon?

amirmalka avatar Dec 10 '19 11:12 amirmalka

If someone else submits a PR I would be happy to merge it.

If not, it will have to wait until I find some time to work on this project again, which will definitely not be before next year.

IzakMarais avatar Dec 10 '19 12:12 IzakMarais

@IzakMarais waiting for your kind approval :)

amirmalka avatar Apr 22 '20 17:04 amirmalka

What would this change do if the dashboard default is 'collapsed'? I would prefer it if the report followed the dashboard default, not simply automatically expand everything.

chelliwell avatar Apr 30 '20 15:04 chelliwell

@chelliwell thanks for the comment, I had not even thought of that. O bother! @amirmalka any ideas?

IzakMarais avatar Apr 30 '20 15:04 IzakMarais

I recognise that you are constrained quite a lot by what the Grafana API makes possible. (e.g. Annotations in the pdf would be fantastic, but I've no idea how you would get them!) Given those constraints, I think there is some case for not blindly over-riding what Grafana presents - if you don't have the ability to control what it generates then I think it fair if the 'problem' (timezone, collapsed panels etc) are treated as being due to Grafana and/or the dashboard, not your code. You're essentially using their API - if that is missing some features then it's not your fault! ;)

chelliwell avatar Apr 30 '20 15:04 chelliwell

@chelliwell I understand this need, I thought about it too. Maybe we can leave the default as it is and give an option/flag to generate the 'full' dashboard? What do you think?

amirmalka avatar Apr 30 '20 15:04 amirmalka

@chelliwell I understand this need, I thought about it too. Maybe we can leave the default as it is and give an option/flag to generate the 'full' dashboard? What do you think?

I haven't looked at what controls Reporter has over requesting collapsed vs. expanded. My own uses will be two types: from the Grafana web UI, where I'd definitely prefer Reporter to capture how I have the web page showing at that time. But also from command line - if that is the dashboard defaults then I think that is justified; if there's an over-ride option available to 'expand all' then fair enough, I can see that being useful. Of course someone will then want to be able to specify which to expand..... :S ;)

chelliwell avatar Apr 30 '20 15:04 chelliwell

Sorry for the long time between replies.

Maybe we can leave the default as it is and give an option/flag to generate the 'full' dashboard? What do you think?

This sounds like a good plan to me. @amirmalka If you include it in the PR that would be good.

Of course someone will then want to be able to specify which to expand..... :S ;)

Lets not go there, that seems too complex.

IzakMarais avatar Sep 22 '20 09:09 IzakMarais