Skip to content

Instantly share code, notes, and snippets.

@padilo
Last active April 7, 2017 11:43
Show Gist options
  • Save padilo/fa0eb3abd85a5d22a758831e75e797de to your computer and use it in GitHub Desktop.
Save padilo/fa0eb3abd85a5d22a758831e75e797de to your computer and use it in GitHub Desktop.
Query kafka burrow consumer status http endpoint
#/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