Hi Peter,
The lifecycle of these metrics are coupled with lifecycle of task, So the metrics would be initialized after task is restarted. I think of one possible option is that you could store your required metrics into state, then the metric states would be restored from backend after task is restarted.
Best,
Zhijiang
------------------------------------------------------------------
Send Time:2019年4月14日(星期日) 00:25
Subject:Retain metrics counters across task restarts
Hi all
We're exposing Prometheus metrics from our Flink (v1.7.1) pipeline to Prometheus, e.g: the total number of processed records. This works fine until any of the tasks is restarted within this yarn application. Then the counter is reset and it starts incrementing values from 0.
How can we retain such counter through the entire lifetime of the yarn application similarly to Hadoop counters?
Thanks
Peter