Andrew Otto
03/13/2023, 4:35 PMAndrew Otto
03/13/2023, 4:38 PMAndrew Otto
03/13/2023, 4:39 PMDian Fu
03/14/2023, 2:42 AMclass MyProcessFucntion(ProcessFucntion):
def __init__(self):
self.counter = None
def open(self, runtime_context: RuntimeContext):
self.counter = runtime_context.get_metric_group().counter("my_counter")
def process_element(self, value, ctx: 'ProcessFunction.Context'):
self.counter.inc(1)
See more details on https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/dev/python/table/metrics/ (PS: a little tricky here why referring to Table API doc, however, it shares the same usage for metrics between Table API and DataStream API)
• Side output: I don’t see why you think it may have problems for side output when working with metrics. Per my understanding, it should just work.Andrew Otto
03/14/2023, 8:17 AMAndrew Otto
03/14/2023, 8:27 AMAndrew Otto
03/14/2023, 8:28 AMDian Fu
03/14/2023, 8:57 AMDian Fu
03/14/2023, 8:57 AMAndrew Otto
03/27/2023, 3:57 PMAndrew Otto
03/27/2023, 6:33 PM