Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't see timestamps in Apache Kafka 0.10.0.0. RC4

Tags:

apache-kafka

Hi I have downloaded Apache Kafka 0.10.0.0. RC4 from here, which has the ability now attach timestamps to messages as stated here.

I have then run it on my server as I normally would and it is receiving logs.

But when I am running the Kafka consumer console to view a topic, the logs look no different and have no timestamp? They are sent to Kafka in JSON would this affect things? Can you see them in the consumer console? IF not where?

I am trying to see how long it takes to get through the first stage of my pipeline.

like image 810
Nate Uni Avatar asked May 12 '16 02:05

Nate Uni


1 Answers

By default the timestamp is not shown when running the console consumer. You must enable it via a property setting:

# `print.timestamp=true` requires Kafka 0.10.0+
$ kafka-console-consumer.sh --property print.timestamp=true [...]

Btw, you may also consider adding --property print.key=true so that the console consumer also prints the key of a Kafka message.

Also, the application that writes to Kafka must support the new Kafka 0.10 message format, which includes the new embedded timestamps. Perhaps you can't see the timestamps because the upstream application/producer never included any.

like image 153
Michael G. Noll Avatar answered Oct 05 '22 08:10

Michael G. Noll