I started a local flink server (./bin/start-cluster.sh), and submitted a job. I have the following code to define a custom metric:
.map(new RichMapFunction<String, String>() {
private transient Counter counter;
@Override
public void open(Configuration config) {
this.counter = getRuntimeContext()
.getMetricGroup()
.counter("myCounter");
}
@Override
public String map(String value) throws Exception {
this.counter.inc();
return value;
}
})
But when I run the job and send some data, I cannot see any metrics in flink web UI, just "No metrics"
I had configured the JMX reporter in the flink-conf.yaml. I am not sure how could I get the metrics shown on the dashboard?