Created
February 14, 2018 23:32
-
-
Save rajiteh/5082dd878c14600f8fded3d8feb0274f to your computer and use it in GitHub Desktop.
because prometheus ui is terrible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PROMETHEUS_SERVER="http://prometheus-server.example.com" | |
# install prometheus-query from https://github.com/ryotarai/prometheus-query | |
# $ go get -u github.com/ryotarai/prometheus-query | |
while IFS="" read -r -e -d $'\n' -p 'query> ' query; do | |
history -s "$query" | |
prometheus-query -start "1 minute ago" -query "$query" --format tsv | column -t | |
echo "---" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment