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

Added code to update grafana dashboards on monitoring-integration start #576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anmolsachan
Copy link
Member

Signed-off-by: Anmol Sachan [email protected]

@codecov
Copy link

codecov bot commented Sep 21, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@ecf7299). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #576   +/-   ##
=========================================
  Coverage          ?   44.95%           
=========================================
  Files             ?       40           
  Lines             ?     2307           
  Branches          ?      346           
=========================================
  Hits              ?     1037           
  Misses            ?     1217           
  Partials          ?       53
Impacted Files Coverage Δ
tendrl/monitoring_integration/grafana/dashboard.py 16.41% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecf7299...ae00c4a. Read the comment docs.

title.append(dashboard_json["uri"].split('/')[1])

for dashboard_json in NS.config.data["dashboards"]:
if dashboard_json in title:
Copy link
Member Author

@anmolsachan anmolsachan Sep 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if condition is checking two completely different things:
["cluster-dashboard", "brick-dashboard", "host-dashboard", "volume-dashboard"] &
['tendrl-gluster-at-a-glance', 'tendrl-gluster-hosts', 'tendrl-gluster-volumes', 'tendrl-gluster-bricks']

But its not failing as we are going down straight to creating the dashboard again. The dashboards cannot get updated as the grafana rejects the request with : {u'status': u'name-exists', u'message': u'A dashboard with the same name already exists'} .

dashboard = dashboard_json["uri"].split('/')[1]
title.append(dashboard)
# Deleting already existing dashboards if present
response = dashboard_utils.delete_dashboard(dashboard)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to delete all dashboards in every sync. I think we need to find a better way of handling this situation.

We need to see if there is an intersection/difference between the two files then only we need to update it. Otherwise, the will keep refreshing the dashboards and can cause a problem(while a user is at a particular dashboard) also it increases the number of calls on the server.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cloudbehl agreed, will see to it.

@cloudbehl
Copy link
Member

@anmolsachan can you attach Bugzilla to this issue

@anmolsachan
Copy link
Member Author

@anmolsachan can you attach Bugzilla to this issue

We dont have one right now, this might go in an update later, will do it when we get a go on this.

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