简体   繁体   English

如何在 Apache Flink ui 中显示指标?

[英]How to display metrics in Apache Flink ui?

running Apache Flink 1.8.0.运行 Apache Flink 1.8.0。 I can access the UI at http://localhost:8081 that works.我可以在http://localhost:8081上访问有效的 UI。 I have also verified that my job works from the IDE, submitting by command line using ./flink run .我还验证了我的工作在 IDE 中工作,使用./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.但是当我查看 UI 上的统计数据时,我只看到了一个微调器。 Example: Bytes Receives, Records Received, Bytes Sent, Records Sent all have a spinner.示例:Bytes Receives、Records Received、Bytes Sent、Records Sent 都有一个微调器。

Also I'm doing in my RichAsyncFunction我也在做我的RichAsyncFunction

It's not clear in the docs for the UI, do we need to enable something on the Flink server? UI 的文档中不清楚,我们是否需要在 Flink 服务器上启用某些功能?

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.我无法单击“ Add metric按钮。

I had the same problem ... but I ran flink in a docker swarm.我遇到了同样的问题……但是我在 docker swarm 中运行了 flink。

In flink-config file, I used the host name for the task managers name.在 flink-config 文件中,我使用主机名作为任务管理器名称。 If change I it and use the flink random names for the task managers, the metrics appear again.如果更改它并为任务管理器使用 flink 随机名称,则指标会再次出现。

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我希望有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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