Last active
April 7, 2017 11:43
-
-
Save padilo/fa0eb3abd85a5d22a758831e75e797de to your computer and use it in GitHub Desktop.
Query kafka burrow consumer status http endpoint
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
#/usb/bin/env bash | |
if [[ $# -ne 2 ]]; then | |
echo "usage $0 <jq query> <monitor host>" | |
exit -1 | |
fi | |
jq_query=$1 | |
host=$2 | |
( | |
for cluster_name in $(curl -Ss $host:8000/v2/kafka | jq -r '.clusters | join("\n")'); do | |
for consumer_name in $(curl -sS http://$host:8000/v2/kafka/$cluster_name/consumer | jq -r '.consumers | join("\n")'); do | |
curl -Ss http://$host:8000/v2/kafka/$cluster_name/consumer/$consumer_name/lag | |
done | |
done | |
) | jq "$jq_query" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment