Skip to content

Commit

Permalink
Fixing alert dashboard issue with grafana 5.x.x
Browse files Browse the repository at this point in the history
I did small change to work existing alerting logic to work with
latest grafana.

tendrl-bug-id: #372

Signed-off-by: GowthamShanmugasundaram <[email protected]>
  • Loading branch information
GowthamShanmugam committed Oct 4, 2018
1 parent ecf7299 commit 4e1f029
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions tendrl/monitoring_integration/grafana/alert_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,16 @@ def create_resource_dashboard(resource_name, resource):
resource_json["dashboard"]["title"] = "Alerts - " + \
str(resource_json["dashboard"]["title"])
resource_rows = resource_json["dashboard"]["rows"]
global_row = {"collapse": False,
global_row = {"collapse": True,
"height": 250,
"panels": [],
"repeat": None,
"repeatIteration": None,
"repeatRowId": None,
"showTitle": False,
"title": "Dashboard Row",
"titleSize": "h6"
"title": resource["resource_name"],
"titleSize": "h6",
"type": "row"
}
new_resource_panels = get_panels(resource_rows)
alert_thresholds = NS.monitoring.definitions.get_parsed_defs()[
Expand Down Expand Up @@ -311,6 +312,7 @@ def add_gluster_resource_panel(
resource_type = "nodes"
panel_count = most_recent_panel_id
for alert_row in alert_rows:
alert_row["title"] = resource_name
panel_count += 1
for panel in alert_row["panels"]:
targets = panel["targets"]
Expand Down
2 changes: 0 additions & 2 deletions tendrl/monitoring_integration/grafana/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def upload_default_dashboards():

if 'dashboard' in dashboard_json:
dashboard_id = dashboard_json.get('dashboard').get('id')
response = dashboard_utils.set_home_dashboard(dashboard_id)

response = dashboard_utils.set_home_dashboard(dashboard_id)
if response.status_code == 200:
msg = '\n' + "Dashboard " + \
Expand Down

0 comments on commit 4e1f029

Please sign in to comment.