1
votes

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"

enter image description here

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

1 Answers

0
votes

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