Skip to content

Instantly share code, notes, and snippets.

@rajiteh
Created February 14, 2018 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajiteh/5082dd878c14600f8fded3d8feb0274f to your computer and use it in GitHub Desktop.
Save rajiteh/5082dd878c14600f8fded3d8feb0274f to your computer and use it in GitHub Desktop.
because prometheus ui is terrible
#!/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