grafana-toolbox / grafana-import

Import and export Grafana dashboards using the Grafana HTTP API and grafana-client, supporting dashboard-as-code workflows.
https://community.panodata.org/t/grafana-import-import-and-export-grafana-dashboards/295
Apache License 2.0
12 stars 4 forks source link

GRAFANA_TOKEN env variable is not passed correctly #16

Open julialau23 opened 3 weeks ago

julialau23 commented 3 weeks ago

When the Grafana class is initialized in grafana.py, there is only a check for the "url" field in the parameters. If the GRAFANA_TOKEN env variable is set, the token is never passed to the GrafanaApi client and therefore results in a GrafanaUnauthorizedError when making requests using grafana_client. A credential field needs to be added to the from_url call to populate the GRAFANA_TOKEN env variable.

amotl commented 5 days ago

Dear @julialau23. Thanks a stack for the report. May we ask if you would have the capacities to submit a patch?