Hey there folks. I’m currently using Flink mainly...
# troubleshooting
p
Hey there folks. I’m currently using Flink mainly with Kafka as source. Flink kafka consumers are treated as non-active consumers from Kafka. Therefore we do not have lag metrics of those consumers exported. Do you folks have the same issue? How did you overcome it? Confluent is my current Kafka provider.
m
That's a Confluent problem unfortunately, not a Flink problem
p
For sure. Is this channel wrong for this? Apologies
m
No no worries, I know because I work for Confluent 🙂
But see https://docs.confluent.io/cloud/current/monitoring/monitor-lag.html#use-the-metrics-api-to-monitor-ak-consumer-lag
Metrics API does not include consumers that use the assign() method. This is because the coordinator of a consumer group does not manage consumer assignment for consumers assigned to topics and partitions using assign().
The Flink Kafka connector commits its offset back to Kafka, especially for monitoring purposes, as part of its checkpoint integration
p
Yeah. Sometimes I go back to my old friend binaries and describe the consumer groups as last resource. The question was more like “have someone built an wrapper to fetch this data from confluent 😛”
m
I don't think anyone can build a wrapper for that unless someone wants to wrap the entire offset committing part in Flink and also send that somewhere else 😅
p
I thought about a wrapper around
./kafka-consumer-groups.sh
and convert the output in a JMX like metric to export.
m
I'm not sure that Confluent register the Flink consumer groups all together; do you see the Flink consumer groups when you run that command?
p
I don’t see them in the listing. But once I describe them I have the data. And since my infra is terraformed, I have the list of the consumer-groups available. So I could iterate on them
Copy code
./kafka-consumer-groups.sh --bootstrap-server=`grep "^\s*bootstrap.servers" ${KAFKA_CONFIG} | cut -d'=' -f2` \
  --command-config=${KAFKA_CONFIG} \
  --describe --group flink-X
works for example
With the argument
--all-groups
I get them listed. So I can build something generic enough to pull this data from confluent
Copy code
./kafka-consumer-groups.sh --bootstrap-server=`grep "^\s*bootstrap.servers" ${KAFKA_CONFIG} | cut -d'=' -f2` --all-groups --list \
  --command-config=${KAFKA_CONFIG}
m
Gotcha