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

Name to uid change #6

Merged
merged 2 commits into from
Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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