Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(auth): pass GRAFANA_TOKEN env variable on Grafana initialization #20

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Oct 3, 2024

Improvement submitted by @jl2397. Thanks!

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. This adds a credential field to the from_url call and populates it with the GRAFANA_TOKEN env variable.

This is coming from GH-19, but needed more code formatting.

@amotl amotl merged commit fbdbc55 into main Oct 3, 2024
2 checks passed
@amotl amotl deleted the jl2397/improve-auth branch October 3, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants