简体   繁体   中英

How to display metrics in Apache Flink ui?

running Apache Flink 1.8.0. I can access the UI at http://localhost:8081 that works. I have also verified that my job works from the IDE, submitting by command line using ./flink run . I have even uploaded the job through the UI. The job works fine.

But when I look at the stats on the UI, I only see a spinner. Example: Bytes Receives, Records Received, Bytes Sent, Records Sent all have a spinner.

Also I'm doing in my RichAsyncFunction

It's not clear in the docs for the UI, do we need to enable something on the Flink server?

private transient Counter lookupCounter;
@Override
public void open(Configuration parameters) throws Exception {
    super.open(parameters);

    this.lookupCounter = getRuntimeContext()
            .getMetricGroup()
            .addGroup("MyGroup")
            .counter("myCounter");
}

@Override
public void asyncInvoke(String input, ResultFuture<Map<String, Integer>> resultFuture) throws Exception {
    lookupCounter.inc();
}

Also clicking on Task metrics I get nothing. I can't click the Add metric button.

I had the same problem ... but I ran flink in a docker swarm.

In flink-config file, I used the host name for the task managers name. If change I it and use the flink random names for the task managers, the metrics appear again.

In other hand, I read that you may be sure that not use "detached mode" at run, because the metrics are not available in detached mode.

I hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM