Skip to content

Commit

Permalink
Add make task for checking metrics using promtool
Browse files Browse the repository at this point in the history
Signed-off-by: toby lorne <toby@toby.codes>
  • Loading branch information
tlwr committed Mar 20, 2020
1 parent 4e1bad2 commit de41b23
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Expand Up @@ -57,3 +57,12 @@ show_metrics:
| awk 'NR%2 == 1 { s=50-length($$0) ; $$0 = sprintf("%s%" sprintf("%s", s) "s", $$0, "") }1' `# right pad the help text`\
| sed 'N;s/\n/ /' `# put help text and metric name on same line` \
| sort

check_metrics: build cleanup_mongo start_mongo
$(BINARY) & echo "$$$$!" > /tmp/router.pid
@until [ "`curl -s -o /dev/null -w '%{http_code}' http://localhost:8081/metrics`" = "200" ]; do \
echo '.\c' ; \
sleep 1 ; \
done ; \
echo
(curl -sf http://localhost:8081/metrics ; &> /dev/null kill $$(cat /tmp/router.pid)) | promtool check metrics

0 comments on commit de41b23

Please sign in to comment.