CorpGlory / grafana-data-exporter-panel

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

There is no record for exporting CSV #75

Open luidso opened 3 years ago

luidso commented 3 years ago

After following the steps, when using the grafana data exporter to export data, the task is added successfully, but the data is 0. Grafana log status = 400, and the size of CSV in the grafana data exporter is 0. grafana:7.1.5 grafana-data-exporter:0.5.1 log:t=2021-07-20T09:13:08+0800 lvl=info msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/api/datasources/proxy/2/api/v1/query_range status=400 remote_addr=ipv4 time_ms=19 size=119 referer=

rozetko commented 3 years ago

hey @luidso! which datasource are you trying to export data from?

luidso commented 3 years ago

prometheus

luidso commented 3 years ago

grafana-data-exporter log:0 day: 1626753801604ms -> 1626840201604ms Data kit: fail while request data: Request failed with status code 400 query url: "/api/datasources/proxy/2/api/v1/query_range" Response: status: 400, response data: {"status":"error","errorType":"bad_data","error":"invalid parameter \"start\": cannot parse \"\" to a valid timestamp"}, headers: {"content-type":"application/json","date":"Tue, 20 Jul 2021 10:03:26 GMT","x-content-type-options":"nosniff","x-frame-options":"deny","x-xss-protection":"1; mode=block","content-length":"119","connection":"close"}

(node:4898) UnhandledPromiseRejectionWarning: Error: Data kit: fail while request data: Request failed with status code 400 at /opt/prometheus/grafana-data-exporter-0.5.1/dist/server.js:32479:19 at Generator.throw () at rejected (/opt/prometheus/grafana-data-exporter-0.5.1/dist/server.js:32377:65) at processTicksAndRejections (internal/process/task_queues.js:95:5) (node:4898) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 20)

It seems that the request URL has no parameters for splicing query? query=up&start=2021-07-19T20:10:30.781Z&end=2021-07-20T20:11:00.781Z&step=15s

rozetko commented 1 year ago

Hey @luidso,

Grafana breaks the API all the time. If you really need this, we can fix it. Meanwhile, maybe you want to checkout this link? https://www.patreon.com/corpglory