+1 to what Zhenghua said. You're abusing the metrics system I think. Rather just do a stream.keyBy().sum() and then write a Sink to do something with the data -- for example push it to your metrics system if you wish.
However, from experience, many metrics systems don't like that sort of thing. High cardinality metrics are usually a problem so I would expect to run into issues depending on what metrics system you are trying to get the data into. -Jamie On Wed, Jan 16, 2019 at 8:32 PM Zhenghua Gao <doc...@gmail.com> wrote: > So what you want is the counts of every keys ? > Why didn't you use count aggregation? > > > > -- > Sent from: > http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ >