Skip to content

Commit

Permalink
Merge pull request #6 from maciejmazur10c/name-to-uid-change
Browse files Browse the repository at this point in the history
Name to uid change
  • Loading branch information
Grzegorz authored Nov 17, 2021
2 parents 5799499 + 24d44a8 commit 1169abd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions prom_metrics_check/prom_metrics_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ def get_all_metrics(dashboards=None):


def load_dashboard(url=None, key=None):
dashboards, dashboards_name = [], []
dashboards, dashboards_uid = [], []
search_dashboard = request_get(
'{url}/api/search'.format(url=url), token=key)
if search_dashboard.ok:
dashboards_name = [dash.get('uri') for dash in search_dashboard.json()]
for name in dashboards_name:
dashboard = request_get('{url}/api/dashboards/{name}'.format(
dashboards_uid = [dash.get('uid') for dash in search_dashboard.json()]
for name in dashboards_uid:
dashboard = request_get('{url}/api/dashboards/uid/{name}'.format(
url=url, name=name), token=key)
if dashboard.ok:
dashboards.append(dashboard.json().get('dashboard', {}))
Expand Down

0 comments on commit 1169abd

Please sign in to comment.