IzakMarais / reporter

Service that generates a PDF report from a Grafana dashboard
Apache License 2.0
946 stars 304 forks source link

Reporting breaks with HTTPS Grafana server #354

Open alexanderjardim opened 9 months ago

alexanderjardim commented 9 months ago

I am running grafana-reporter using the following command

 grafana-reporter -ip https://grafana.myservice -grid-layout=1 --ssl-check=false

Then, when I try to generate a report, I get the following error

2023/09/22 13:56:51 Connecting to dashboard at http://https://grafana.myservice/api/dashboards/uid/f30bb6c9-b725-48ca-8572-b2096aff90d4
2023/09/22 13:56:56 Error generating report: error fetching dashboard f30bb6c9-b725-48ca-8572-b2096aff90d4: error executing getDashboard request for http://https://grafana.myservice/api/dashboards/uid/f30bb6c9-b725-48ca-8572-b2096aff90d4: Get "http://https//grafana.myservice/api/dashboards/uid/f30bb6c9-b725-48ca-8572-b2096aff90d4": dial tcp: lookup https: Try again

As we can see, reporter is building the url wrong.

liliwanggithub commented 7 months ago

Hi alexanderjardim,

I check the source code it can be change the default http to http as below command line

grafana-reporter -cmd_enable=1 -cmd_apiKey xxx -proto https:// -ip localhost:3000 ssl-check false -cmd_dashboard -cmd_ts from=now-1d -cmd_o out.pdf you can try