Hello community,

I would like to know how long it takes for an event to flow through the
whole Flink pipeline, that consumes from Kafka and sinks to Redis.

My current idea is, for each event:

1. calculate a start_time in source (timestamp field of [metadata](
https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/table/connectors/kafka.html#available-metadata)
or flink PROCTIME)
2. calculate end_time in the sink (System.currentTimeMillis or flink
PROCTIME)
3. push the (end_time - start_time) to Prometheus

I wonder if flink provides a better and more native way of to calculate the
time spent in Flink?

Thanks!

Best,
Xiuming

Reply via email to