Skip to content

Commit

Permalink
Merge pull request #82 from scality/etcd_grafana_dashboard
Browse files Browse the repository at this point in the history
Etcd grafana dashboard
  • Loading branch information
Zempashi committed Jul 2, 2018
2 parents 963ffdf + 7f73bdf commit 0f63653
Show file tree
Hide file tree
Showing 5 changed files with 2,428 additions and 8 deletions.
25 changes: 19 additions & 6 deletions hack/check-vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,31 @@
red = lambda s: '{}{}{}'.format(RED, s, RESET)
bold = lambda s: '{}{}{}'.format(BOLD, s, RESET)

def check_module(root, module):
#sys.stdout.write('Checking module {!r}...\n'.format(module['path']))

assert module['source']['type'] == 'git-subtree'
def check_module_subtree(root, module):

latest_commit = find_latest_squash(module['path'], root)
latest_remote = find_latest_remote(
module['source']['repository'], module['source']['ref']).decode('ascii')
module['source']['repository'], module['source']['ref']
).decode('ascii')

rc = False
return latest_commit[1] == latest_remote, latest_remote, latest_commit

if latest_commit[1] == latest_remote:
def check_module(root, module):
# sys.stdout.write('Checking module {!r}...\n'.format(module['path']))

module_check_mapping = {
'git-subtree': check_module_subtree,
'url': lambda *args: (True, None, None)
}
try:
rc, latest_remote, latest_commit = module_check_mapping[
module['source']['type']
](root, module)
except KeyError as exc:
raise AssertionError('Unsupported source type: {}'.format(exc.args[0]))

if rc:
sys.stdout.write(
'{} Subtree {} up to date\n'.format(green(TICK), bold(module['path'])))
rc = True
Expand Down
8 changes: 6 additions & 2 deletions roles/kube_prometheus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
GRAFANA_DASHBOARD_YAML=files/additionnal_dashboard.yml
SRCDIR=src

GRAFANA_DASHBOARD=$(wildcard $(SRCDIR)/*.json)
GRAFANA_DASHBOARD=\
../../vendor/etcd/Documentation/op-guide/grafana.json \
$(wildcard $(SRCDIR)/*.json)


all: compile

Expand Down Expand Up @@ -31,7 +34,8 @@ compile:
echo ' ],'; \
echo ' "overwrite": true,'; \
echo ' "dashboard":'; \
sed 's/^/ /' $${dashboard}; \
sed -e 's/^/ /' \
-e '/^\s*$$/d' $${dashboard}; \
echo ' }'; \
) >> $(GRAFANA_DASHBOARD_YAML); \
done;
Expand Down

0 comments on commit 0f63653

Please sign in to comment.