Hi everyone, I have a Flink Java service that has ...
# troubleshooting
u
Hi everyone, I have a Flink Java service that has a Kafka source, performs some processing, and then writes to a Kafka sink. I am trying to find a way to measure the end-to-end delay from one Kafka topic to another within the Flink service. The solution I found so far is to attach a timestamp to the POJO at the beginning of the service and then, at the end of the service, calculate the time difference from that timestamp. Is there a simpler, built-in way in Flink to measure this end-to-end delay? Thanks!
p
Never used it myself, but you might want to look into the metric reporters. See here https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/deployment/metric_reporters/
m
As noted above there are some built in ways to monitor latency via metrics. The link attached below may help but there are warnings starting that it is only really recommended for debugging: https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/ops/metrics/#end-to-end-latency-tracking Using timestamps within messages to calculate may be the best way to get what you are looking for. In doing it this way, you may even be able to get more useful measurements, depending on your use case. For example, you can read the time that any given message was written to a kafka topic and as such calculate the latency from time landed in Kafka to the time written out