问题
I started a local flink server (./bin/start-cluster.sh), and submit a job. I have the following code to define an metrics.
.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 so "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?
回答1:
I had the same problem. My problem was in cluster configuration, I was using the hostname to name the taskmanager, and when I change it (using the default name) , the task metrics start to work. I use docker-swarm to deploy the flink cluster.
This is my question Flink 1.7.0 Dashboard not show Task Statistics
I was talking about the task statistics, but the taskmetrics was wrong too
来源:https://stackoverflow.com/questions/56235219/no-metrics-in-flink-webui