confluentinc / kafka-rest

Confluent REST Proxy for Kafka
https://docs.confluent.io/current/kafka-rest/docs/index.html
Other
42 stars 644 forks source link

Offset storage for kafka-rest #178

Closed VladSergeev closed 8 years ago

VladSergeev commented 8 years ago

Hello, We use Apache kafka 0.9.0 and Kafka-Rest 2.0.0. For our buisness purposes we should create monitoring service for understanding consumer's lag(we write something like KafkaOffsetMonitor). If I create a consumer natively(using java) and we can see offsets in Zookeeper(useing zkCli).

Example: /var/lib/zookeeper/bin/zkCli.sh Then: [zk: localhost:2181(CONNECTED) 1] ls /consumers/my-consumer [ids, owners, offsets]

So we could use ZkUtils in java to get consumer's offsets.

If I create a consumer with kafka-rest,I can read data(of course I can): //create consumer curl -i -X POST -H "Content-Type: application/vnd.kafka.v1+json" --data "{\"id\": \"kek_instance\", \"format\": \"binary\", \"auto.offset.reset\": \"smallest\"}" http://localhost:8082/consumers/VLAD_test_consumer //read data curl -i -X GET -H "Accept: application/vnd.kafka.binary.v1+json" http://localhost:8082/consumers/VLAD_test_consumer/instances/kek_instance/topics/_METRIC_TOPIC

But if will look in zookeeper: [zk: localhost:2181(CONNECTED) 2] ls /consumers/VLAD_test_consumer [ids, owners]

So I can't use some methods of ZkUtils for getting consumers-per-topic,offsets,etc.

Could you, please, give me information about getting kafka-rest consumers offsets to have correct monitoring?

VladSergeev commented 8 years ago

Question resolved.