본문 바로가기
Dev/Kafka

Kafka Monitoring Tool - Kafka Offset Monitor

by 돈코츠라멘 2019. 12. 26.

Kafka Offset Monitor

 

시간에 따른 offset과 lag를 그래프로 확인할 수 있다.

 

This is an app to monitor your kafka consumers and their position (offset) in the queue.
You can see the current consumer groups, for each group the topics that they are consuming and the position of the group in each topic queue. This is useful to understand how quick you are consuming from a queue and how fast the queue is growing. It allows for debuging kafka producers and consumers or just to have an idea of what is going on in your system.
The app keeps an history of queue position and lag of the consumers so you can have an overview of what has happened in the last days.

Kafka Offset Monitor는 kafka consumer와 queue에 있는 consumer offset을 모니터링하는 데 사용한다. 현재 consumer group이 사용 중인 topic들과 group에 속한 consumer가 어떤 topic을 소비하는지, 그리고 얼마나 빠른 속도로 queue가 증가하고 있는지 등을 확인할 수 있다. 이를 통해 kafka producer와 consumer를 디버깅하고 시스템에서 어떤 일이 일어나고 있는지 확인한다.

Download

http://quantifind.github.io/KafkaOffsetMonitor/

 

Kafka Offset Monitor by quantifind

Kafka Offset Monitor This is an app to monitor your kafka consumers and their position (offset) in the queue. You can see the current consumer groups, for each group the topics that they are consuming and the position of the group in each topic queue. This

quantifind.github.io

  • 방법 (1) : 홈페이지에서 zip 또는 tar.gz로 압축된 소스코드를 다운받아서 빌드해서 사용한다.
  • 방법 (2) : 아래 링크에서 바로 jar 파일을 받아서 실행한다.

https://github.com/quantifind/KafkaOffsetMonitor/releases/tag/v0.2.1

 

quantifind/KafkaOffsetMonitor

A little app to monitor the progress of kafka consumers and their lag wrt the queue. - quantifind/KafkaOffsetMonitor

github.com

 

Usage

java -cp KafkaOffsetMonitor-assembly-0.2.1.jar \
     com.quantifind.kafka.offsetapp.OffsetGetterWeb \
     --zk zk-server1,zk-server2 \
     --port 8080 \
     --refresh 10.seconds \
     --retain 2.days

 

  • zk the ZooKeeper hosts
  •  port on what port will the app be available
  •  refresh how often should the app refresh and store a point in the DB
  •  retain how long should points be kept in the DB
  •  dbName where to store the history (default 'offsetapp')

 

 

Warning!!!!!!

2019-12-18 14:47:46 ERROR KafkaOffsetGetter$:103 - The message was malformed and does not conform to a type of (BaseKey, OffsetAndMetadata. Ignoring this message.
kafka.common.KafkaException: Unknown offset schema version 3
        at kafka.coordinator.GroupMetadataManager$.schemaForOffset(GroupMetadataManager.scala:739)
        at kafka.coordinator.GroupMetadataManager$.readOffsetMessageValue(GroupMetadataManager.scala:884)
        at com.quantifind.kafka.core.KafkaOffsetGetter$.tryParseOffsetMessage(KafkaOffsetGetter.scala:277)
        at com.quantifind.kafka.core.KafkaOffsetGetter$.startCommittedOffsetListener(KafkaOffsetGetter.scala:351)
        at com.quantifind.kafka.OffsetGetter$$anon$3.run(OffsetGetter.scala:289)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Kafka 2.1 이상의 버전에서는 offset schema를 알수 없다는 Exception이 발생하고 정상적으로 동작하지 않는다. 

 

2.1 이상의 버전에서 사용하고 싶은 경우는 아래 링크를 참조한다. 

 

2019/12/25 - [Open Source/Kafka] - Kafka 2.1 이상에서 Kafka Offset Monitor 사용하기 - kafka.common.KafkaException: Unknown offset schema version 3 해결

 

Kafka 2.1 이상에서 Kafka Offset Monitor 사용하기 - Unknown offset schema version 3 해결

2019-12-19 14:52:58 ERROR KafkaOffsetGetter$:103 - The message was malformed and does not conform to a type of (BaseKey, OffsetAndMetadata. Ignoring this message. kafka.common.KafkaException: Unknow..

deep-dive-dev.tistory.com

 

댓글