CorpGlory / grafana-data-exporter-panel

Panel for exporting metrics from Grafana dashboards
32 stars 8 forks source link

Issue in showing Progress and downloading #63

Closed sabir-piludiya closed 4 years ago

sabir-piludiya commented 4 years ago

I have used dashboard from the example in this repo. I've also installed the SimpleJson Plugin in Grafana. However When I click on export and add task nothing is shown at Progress panel. the data is available at exporter side. I need to have progress bar in Dashboard from where I can download it directly. It shows following error in the progress panel :

Expected response data to be array, got string.

In console I get following error when click on add task :

Cannot find datasource id in url

Please if you can help to fix this. Thanks.

rozetko commented 4 years ago

Hi @sabir-piludiya,

Progress panel uses SimpleJson datasource to get list of exported files. Please, make sure you've specified your grafana-data-exporter URL with /datasource in the end while configuring SimpleJson datasource: https://github.com/CorpGlory/grafana-data-exporter-panel/wiki/Simple-JSON-Datasource-config

In case it doesn't help:

sabir-piludiya commented 4 years ago

Hi @rozetko Thanks for quick response. /datasource was trick to get it in my case. I can download files. However I still not able to delete the csv from Progress panel. Showing following error in console during deleting from progress panel:

tti-polyfill.js:4 Mixed Content: The page at 'https://GRAFANA/d/csv-report-exporter/csv-report-exporter?orgId=1' was loaded over HTTPS, but requested an insecure resource 'http://GRAFANA-EXPORTER/delete?filename=1602266159639.all'. This request has been blocked; the content must be served over HTTPS.

I'm using grafana-data-exporter-panel of 0.5.1 and corpglory/grafana-data-exporter docker image. Also there's no error in logs of grafana-data-exporter.

Thanks.

rozetko commented 4 years ago

It's a known problem: https://github.com/CorpGlory/grafana-data-exporter-panel/issues/29. This error appears because your Grafana uses HTTPS, but grafana-data-exporter doesn't.

The best solution would be to run grafana-data-exporter with HTTPS.

The reason is: modern browsers don't allow users to query HTTP from HTTPS.

It'll be fixed as soon as we convert the plugin to application (so that we can use Grafana server as proxy to query the grafana-data-exporter server)

sabir-piludiya commented 4 years ago

@rozetko You are right however I'm already running grafana-data-exporter in HTTPs. CSV downloading is working. but delete is not working (Sends Unexpected Error in grafana)

rozetko commented 4 years ago

@sabir-piludiya thanks for the feedback, I've reproduced the bug and created an issue: https://github.com/CorpGlory/grafana-data-exporter-panel/issues/65