divinity666 / ruby-grafana-reporter

Reporting Service for Grafana
MIT License
66 stars 5 forks source link

Issue on rendering image [solved] #9

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi!

I'm currently testing your reporter. I cannot create a report yet. See the following problems:

asciidoctor: FAILED:~/grafana/ruby-grafana-reporter/templates/demo_report.adoc: Failed to load AsciiDoc document - uninitialized constant GrafanaReporter::Asciidoctor::PanelImageBlockMacro::GrafanaError
~/.local/share/gem/ruby/3.0.0/gems/ruby-grafana-reporter-0.4.4/lib/grafana_reporter/asciidoctor/panel_image_block_macro.rb:54:in `rescue in process'
~/.local/share/gem/ruby/3.0.0/gems/ruby-grafana-reporter-0.4.4/lib/grafana_reporter/asciidoctor/panel_image_block_macro.rb:48:in `process'

Logs

I, [2021-08-01T22:25:40.590562 #739178]  INFO -- : Report started at 2021-08-01 22:25:40 +1200
D, [2021-08-01T22:25:40.591334 #739178] DEBUG -- : Document attributes: {"convert-backend"=>"pdf", "imagesdir"=>"images", "var-template"=>"demo_report", "from"=>"now-3h", "to"=>"now", "var-DS_PROMETHEUS"=>"Prometheus", "var-job"=>"home", "var-node"=>"localhost:9100", "var-diskdevices"=>"[a-z]+|nvme[0-9]+n[0-9]+"}
D, [2021-08-01T22:25:40.591852 #739178] DEBUG -- : Template ~/grafana/ruby-grafana-reporter/templates/demo_report.adoc contains 14 calls of grafana reporter functions.
D, [2021-08-01T22:25:40.594866 #739178] DEBUG -- : Processing AlertsTableIncludeProcessor (instance: default, dashboard: , panel: )
D, [2021-08-01T22:25:40.595147 #739178] DEBUG -- : Requesting http://localhost:3000/api/frontend/settings with '' and timeout '60'
D, [2021-08-01T22:25:40.614531 #739178] DEBUG -- : Received response #<Net::HTTPOK:0x000060bdbc0336f0>
D, [2021-08-01T22:25:40.620037 #739178] DEBUG -- : Requesting http://localhost:3000/api/alerts?from=1627802740000&to=1627813539000 with '' and timeout '60'
D, [2021-08-01T22:25:40.641879 #739178] DEBUG -- : Received response #<Net::HTTPOK:0x00000acedc4bb288>
D, [2021-08-01T22:25:40.642371 #739178] DEBUG -- : Processing AnnotationsTableIncludeProcessor (instance: default)
D, [2021-08-01T22:25:40.642735 #739178] DEBUG -- : Requesting http://localhost:3000/api/annotations?from=1627802740000&to=1627813539000 with '' and timeout '60'
D, [2021-08-01T22:25:40.664277 #739178] DEBUG -- : Received response #<Net::HTTPOK:0x00000acedc47aeb8>
D, [2021-08-01T22:25:40.664842 #739178] DEBUG -- : Processing ShowHelpIncludeProcessor
D, [2021-08-01T22:25:40.675270 #739178] DEBUG -- : Processing ShowEnvironmentIncludeProcessor
D, [2021-08-01T22:25:40.677141 #739178] DEBUG -- : Processing PanelImageBlockMacro (instance: default, dashboard: Ke8hWXWnz, panel: 17)
D, [2021-08-01T22:25:40.677273 #739178] DEBUG -- : Requesting http://localhost:3000/api/dashboards/uid/Ke8hWXWnz with '' and timeout '60'
D, [2021-08-01T22:25:40.705180 #739178] DEBUG -- : Received response #<Net::HTTPOK:0x00000acedcbc46b0>
D, [2021-08-01T22:25:40.706049 #739178] DEBUG -- : Requesting http://localhost:3000/render/d-solo/Ke8hWXWnz?panelId=17&fullscreen=true&theme=light&timeout=60&var-interval=10s&var-job=home&var-target=%24__all&var-template=demo_report&var-ds_prometheus=Prometheus&var-node=localhost%3A9100&var-diskdevices=%5Ba-z%5D%2B%7Cnvme%5B0-9%5D%2Bn%5B0-9%5D%2B&from=1627802740000&to=1627813539000 with '' and timeout '60'
D, [2021-08-01T22:25:40.776879 #739178] DEBUG -- : Received response #<Net::HTTPInternalServerError:0x00000acedcbf3e38>
I, [2021-08-01T22:25:40.785269 #739178]  INFO -- : Report creation ended after 0 seconds with status 'died'
divinity666 commented 2 years ago

Thanks for using the reporter!

The reporter tries to call the render URL: http://localhost:3000/render/d-solo/Ke8hWXWnz?panelId=17&fullscreen=true&theme=light&timeout=60&var-interval=10s&var-job=home

This is obviously failing. To hunt this issue down, I kindly ask you to check the following:

1) What happens when you call the above mentioned URL in your browser? 2) Your dashboard seems to include one variable, which is set to ˋAllˋ. Could you try the rendering again with something else selected? 3) Manually create an image in your dashboard and post the link. This is done by selecting the panel menu, then click share and finally use the ˋDirect renderingˋ link. Would be interesting to understand the difference the the link generated by the reporter.

Thanks and best regards

ghost commented 2 years ago

Good Morning!

Thank you for pointing this out. I had a bunch of missing libraries. See Grafana image renderer plugin and remote rendering service. I use Arch Linux. Missing libraries:

pacman -Sy at-spi2-atk atk gtk3 mesa nss

Check

ldd /var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome

If anyone comes across the same issue ;)

Now I will learn all this: report

I've just started learning Grafana, etc., so ...

Btw to 1.

Content-Length: 192

GrafanaReporterError: Request 'GET /render/d-solo/Ke8hWXWnz?panelId=17&fullscreen=true&theme=light&timeout=60&var-interval=10s&var-job=home HTTP/1.0' calls an unknown path for this webservice.