mahendrapaipuri / grafana-dashboard-reporter-app

A Grafana plugin app to create PDF reports of dashboards
Apache License 2.0
47 stars 4 forks source link

Failed to call resource #23

Closed henjoe closed 2 weeks ago

henjoe commented 5 months ago

Hi I tried to input this in URL

/api/plugins/mahendrapaipuri-dashboardreporter-app/resources/report?dashUid= but returned an error: ![image](https://github.com/mahendrapaipuri/grafana-dashboard-reporter-app/assets/49782655/73b9a08c-df01-40d3-a3a7-a3a8d89984bb) Other question is, is there other way to enable this app outside the UI of grafana? `Apps > Dashboard Reporter App > Configuration` Thanks and Regards for this great app!
mahendrapaipuri commented 5 months ago

Thanks for your interest @henjoe.

I will need your Grafana server logs to understand why plugin hasn't registered itself with Grafana API. Some of the things you can check

Other question is, is there other way to enable this app outside the UI of grafana? Apps > Dashboard Reporter App > Configuration

Yes, it is possible with provisioning the plugin. Details can be found in docs. You will need to install a provisioned config file (example file can be found in repo) at /etc/grafana/provisioning/plugins/reporter.yml assuming you are using default Grafana provisioning folders. In YAML file, by setting disable: false, the plugin will be enabled by default.

henjoe commented 5 months ago

Thanks for this. To be honest, I just try it to run on grafana V9.0 if it will run, but seems like they have different in terms of UI compared to V10. I know that it requires V10 to use this plugin, I am just curious if it will run on V9.

mahendrapaipuri commented 5 months ago

I think provisioning should work with Grafana >=v7. You can try provisioning the plugin to enable it. I dont see why it should not work in v9.

henjoe commented 5 months ago

Thanks for this. I will try this and informed my testing!

Regards,

henjoe commented 5 months ago

Hello I have managed to enable the App using the Provisioning @ Grafana V9. image

However, trying to create a report as stated here.. https://github.com/mahendrapaipuri/grafana-dashboard-reporter-app/tree/main/src#using-plugin

Gives me this error: "Error Generating Report"

henjoe commented 5 months ago

Seems like the error is about my self-signed certificate: logger=plugin.mahendrapaipuri-dashboardreporter-app t=2024-04-08T20:19:20.0783352+04:00 level=error msg="error generating report" pluginID=mahendrapaipuri-dashboardreporter-app endpoint=callResource err="error fetching dashboard rv683NSIz: error executing request for https://localhost/api/dashboards/uid/rv683NSIz: Get \"https://localhost/api/dashboards/uid/rv683NSIz\": tls: failed to verify certificate: x509: certificate signed by unknown authority" logger=context userId=1 orgId=1 uname=admin t=2024-04-08T20:19:20.0812183+04:00 level=error msg="Request Completed" method=GET path=/api/plugins/mahendrapaipuri-dashboardreporter-app/resources/report status=500 remote_addr=127.0.0.1 time_ms=76 duration=76.21ms size=24 referer= handler=/api/plugins/:pluginId/resources/* logger=context userId=0 orgId=0 uname= t=2024-04-08T20:19:20.8616311+04:00 level=info msg="Request Completed" method=GET path=/favicon.ico status=302 remote_addr=127.0.0.1 time_ms=1 duration=1.8244ms size=29 referer= handler=public-assets

henjoe commented 5 months ago

But I already set in the reporter.yaml settings:

image

mahendrapaipuri commented 5 months ago

Thanks a lot for testing. Could you please share complete logs?

The plugin will output the provisioned config at the beginning. I would like to see those lines to ensure if provisioned config is properly taken into account.

Thanks in advance.