Use of grafana-image-renderer to render entire dashboard

Hello,

I have configured Grafana 6.5.1 to use Grafana-image-renderer as a remote service. I’m able to get PNG of a single panel, but is it possible to get the rendering of an entire dashboard??

I’m confused by information that I find in different places.

Thanks.

Hi

I have exact the same issue. There is no documentation on this topic. The plugin is quite new and I hope someone will give us documentation sooner or later but until we get to this point can anyone point us into good source of information? Posts on various forums are confusing and sometimes don’t match. At the moment plugin works and I can generate panel screenshots from GUI.

I would like to do complete dashboard screenshot with curl or HTTP_API. Already generated the viewer api key to use beerer authentication. Can anyone explain is viewer enough for that task?

Thank you very much for support.

https://HOSTNAME/render/dashboard/db/Dashboard_name

gives me only top left part of the dashboard. It is only 1/4.

https://HOSTNAME/render/dashboard/db/Dashboard_name?orgId=1&refresh=1m&var-station_name=All&from=1576158998288&to=1576763798288&fullscreen
gives the same result.

How can I define time range without using epoch?

About the parameters that can be used in URL:

  • I didn’t notice any change with ‘&fullscreen’. Where did you get it?
  • you can specify ‘width=…’ and ‘height=…’ (in pixels), it may solve your problem
  • I’m not sure you can give time range without epoch
  • there is also ‘&autofitpanels’ that can be useful

Currently I’m using https://HOSTNAME/render/d/uid/Dashboard_name, I don’t see any difference with your URL except that I have to specify the dashboard UID.

FYI, I’m trying to add support for PDF format with a few changes in grafana-image-renderer and grafana.

The issue I see comes from too small rendering window. This is headless machine without GUI. As you can see this is fullscreen (from grafana gui perspective).
I tried:
https://HOSTNAME/render/d/Wnpn7rtZk/DASHBOARDNAME&width=1920&height=1080&autofitpanels

@bgranvea I am able to generate full dashboard png by using link below:

http://HOST_IP:3000/render/d/ybG8WXyZz/dashboard-1?orgId=1&width=1800&height=900&kiosk=tv&from=now-1h&to=now&var-machine=&var-ideal=12
`

However time to time I am getting timeout error. Do you now where or how to increase timeout ? Is it possible to make via url ? I am using docker version of grafana image renderer.

"stack":"TimeoutError: Navigation timeout of 30000 ms exceeded\n at /usr/src/app/node_modules/puppeteer/lib/LifecycleWatcher.js:142:21\n -- ASYNC --\n at Frame.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:111:15)\n at Page.goto (/usr/src/app/node_modules/puppeteer/lib/Page.js:675:49)\n at Page.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:112:23)\n at Browser.<anonymous> (/usr/src/app/build/browser/browser.js:154:28)\n at Generator.next (<anonymous>)\n at /usr/src/app/build/browser/browser.js:7:71\n at new Promise (<anonymous>)\n at __awaiter (/usr/src/app/build/browser/browser.js:3:12)\n at /usr/src/app/build/browser/browser.js:152:47\n at NoOpBrowserTiming.<anonymous> (/usr/src/app/build/browser/browser.js:27:26)\n -- ASYNC --\n at Page.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:111:15)\n at Browser.<anonymous> (/usr/src/app/build/browser/browser.js:154:28)\n at Generator.next (<anonymous>)\n at /usr/src/app/build/browser/browser.js:7:71\n at new Promise (<anonymous>)\n at __awaiter (/usr/src/app/build/browser/browser.js:3:12)\n at /usr/src/app/build/browser/browser.js:152:47\n at NoOpBrowserTiming.<anonymous> (/usr/src/app/build/browser/browser.js:27:26)\n at Generator.next (<anonymous>)\n at /usr/src/app/build/browser/browser.js:7:71","level":"error","message":"Request failed"}

Will reply to myself, got an answer from stackoverflow.com

Altering following line 144 in browser.ts which currently states

await page.goto(options.url, { waitUntil: 'networkidle0' });

to

await page.goto(options.url, { waitUntil: 'networkidle0', timeout: 3000000 });

Hello,
Do You know where can I find browser.ts ? I cannot find it anywhere in grafana-renderer.