Skip to content

Commit

Permalink
fix(auth): pass GRAFANA_TOKEN env variable on Grafana initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jl2397 committed Sep 25, 2024
1 parent aa60253 commit 429d6e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grafana_import/grafana.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import re
import traceback
import typing as t
Expand Down Expand Up @@ -65,7 +66,7 @@ def __init__(self, **kwargs):

# Configure Grafana connectivity.
if "url" in kwargs:
self.grafana_api = GrafanaApi.GrafanaApi.from_url(kwargs["url"])
self.grafana_api = GrafanaApi.GrafanaApi.from_url(url=kwargs["url"], credential=os.environ.get("GRAFANA_TOKEN"))

Check warning on line 69 in grafana_import/grafana.py

View check run for this annotation

Codecov / codecov/patch

grafana_import/grafana.py#L69

Added line #L69 was not covered by tests
else:
config = {}
config["protocol"] = kwargs.get("protocol", "http")
Expand Down

0 comments on commit 429d6e8

Please sign in to comment.