NatelEnergy / grafana-plotly-panel

Show plotly graph in grafana panel
MIT License
145 stars 58 forks source link

Plotly direct link rendered image #103

Open emanuelepica opened 4 years ago

emanuelepica commented 4 years ago

Hi, I've installed plotly on grafana, I've used the grafana docker-compose version for installing grafana (with the plotly plugin) and the grafana image render plugin. It seems that the Direct link rendered image don't work for the plotly panel (render failed). I also tried to install grafana, ploty and grafana render plugin without docker and nothing has changed. I've checked that the image rendering works well on other plugins (like worldmap panel) I already tried to follow the issue #88 and changed the file module.ts in the plugin directory adding the row for the "call renderingCompleted" and then restart the grafana server but also in this way nothing happened (maybe I followed wrong this procedure?). I'm unable to render an image of plotly panels, there is a solution? thank you

Alexadra commented 4 years ago

@emanuelepica Save panel image works by command: curl "http://USER:PASS@host:port/render/d-solo/panelid/panelname?orgId=1&from=1588280400000&to=1592341199999&panelId=16&width=1000&height=500&tz=Europe%2FKiev" > d:/test2.png But it takes 1min 2 seconds to save an image, while saving of regular panel (not Plotly) takes 1-2seconds. Does anyone know while it takes so long?

emanuelepica commented 4 years ago

Thank you @Alexadra, I will try this solution and let you know if it works and how much time the rendering requires

emanuelepica commented 4 years ago

Hi @Alexadra, unfortunately this solution doesn't work for me...moreover, if it takes more than 1 min I think that we will need to find a better solution to solve this issue. thanks, any other ideas from someone else?

MarcoMartines commented 4 years ago

+1 I'm trying to generate a pdf export of the plotly graphs using grafana-reporter which uses grafana render plugin. I'm able to generate the pdf or (it is the same, share direct link rendered image) using another graph type but when i try with plotly i receive following error:

`2020/08/06 13:08:00 Called with api Token: eyJrIjoiV1Q5bXduUkN6RWE5UTFlZ3NZdEhHSEhEOUNHT0J1d2UiLCJuIjoiUERGIEV4cG9ydCIsImlkIjoxfQ== 2020/08/06 13:08:00 Called without variable 2020/08/06 13:08:00 Called with dashboard: ve23ECgMz 2020/08/06 13:08:00 Called with time range: {now-1h now} 2020/08/06 13:08:00 Connecting to dashboard at http://localhost:3000/api/dashboards/uid/ve23ECgMz 2020/08/06 13:08:00 Populated dashboard datastructure: {Title:APS Ele Query Description: VariableValues: Rows:[] Panels:[{Id:4 Type:natel-plotly-panel Title:\$channel - \$drivera vs. \$driverb GridPos:{H:10 W:24 X:0 Y:0}}]} 2020/08/06 13:08:00 Downloading image 4 http://localhost:3000/render/d-solo/ve23ECgMz/_?from=now-1h&height=500&panelId=4&theme=light&to=now&width=1000 2020/08/06 13:09:02 Error obtaining render for panel {Id:4 Type:natel-plotly-panel Title:\$channel - \$drivera vs. \$driverb GridPos:{H:10 W:24 X:0 Y:0}}, Status: 500, Retrying after 10s... 2020/08/06 13:10:14 Error obtaining render for panel {Id:4 Type:natel-plotly-panel Title:\$channel - \$drivera vs. \$driverb GridPos:{H:10 W:24 X:0 Y:0}}, Status: 500, Retrying after 20s... 2020/08/06 13:31:08 Error obtaining render: <!DOCTYPE html>

Grafana - Error
Timeout error. You can set timeout in seconds with &timeout url parameter

Check the Grafana server logs for the detailed error message.

2020/08/06 13:31:08 Error creating image for panel: error getting panel {Id:4 Type:natel-plotly-panel Title:\$channel - \$drivera vs. \$driverb GridPos:{H:10 W:24 X:0 Y:0}}: Error obtaining render: 500 Internal Server Error 2020/08/06 13:31:08 Error generating report: error rendering PNGs in parralel for dash {Title:APS Ele Query Description: VariableValues: Rows:[] Panels:[{Id:4 Type:natel-plotly-panel Title:\$channel - \$drivera vs. \$driverb GridPos:{H:10 W:24 X:0 Y:0}}]}: error getting panel {Id:4 Type:natel-plotly-panel Title:\$channel - \$drivera vs. \$driverb GridPos:{H:10 W:24 X:0 Y:0}}: Error obtaining render: 500 Internal Server Error`

I've tried also the fixed proposed in some other issue (changing the line 520 of module.ts in plotly plugin) but nothing changed.

Do you have any advice?