【发布时间】:2022-12-13 09:59:22
【问题描述】:
我有一个用 Scala 编写的 Flink 应用程序,我用 SBT 构建它。我的目标是将 Flink 指标公开给 Prometheus。 Prometheus 在 Docker 实例中运行,我的 Flink 应用程序在我的计算机上使用 SBT 启动。
Prometheus 运行良好,我可以看到很多指标(例如我的 Docker 指标),但我看不到任何 Flink 指标。
我已经配置文件普罗米修斯.yml使用以下设置:
scrape_configs:
- job_name: 'flink'
static_configs:
- targets: ['host.docker.internal:9250', 'host.docker.internal:9251']
在我的 flink 应用程序中,我添加了以下配置:
val conf = new Configuration()
conf.setLong("rest.port", 8082)
conf.setString("metrics.reporters", "prom")
conf.setString("metrics.reporter.prom.class", "org.apache.flink.metrics.prometheus.PrometheusReporter")
conf.setString("metrics.reporter.prom.port", "9250-9260")
当我运行 Prometheus 和我的 flink 应用程序并转到指标页面时,所有 flink 目标都已关闭 (picture here)。
关于我做错了什么的任何建议?
非常感谢。
【问题讨论】:
标签: sbt apache-flink prometheus