【发布时间】:2021-10-11 16:27:18
【问题描述】:
我正在通过 Prometheus Flink Metrics Reporter 向 prometheus 发送自定义应用程序指标。这些指标是正确创建的,因为我能够在 flink 仪表板中准确地看到它们。我配置了类似于 found here 的 prometheus 指标报告器。当我 curl 到 prometheus 端点(curl http://localhost:9090/api/v1/metrics)时,我只能看到集群指标,而不是我正在创建的自定义指标。我怀疑这个问题与我如何配置 Prometheus Flink Metrics Reporter 有关,因为当我尝试访问 http://localhost:9090 时,没有 UI,只有上面提到的集群指标列表。
用于创建指标的 flink 作业代码(在 Flink UI 中可见):
this.anomalyCounter = getRuntimeContext.getMetricGroup.addGroup("metric1").counter("counter")
flink-conf.yaml:
metrics.reporters: prom
metrics.reporter.prom.class: org.apache.flink.metrics.prometheus.PrometheusReporter
metrics.reporter.prom.port: 9090
promethus.yml:
scrape_configs:
- job_name: 'flink'
static_configs:
- targets: ['localhost:9090']
我在配置中有什么遗漏吗?为什么我的集群指标到达 prometheus 而不是我的自定义指标?
【问题讨论】:
-
尝试其他配置,如此处所示stackoverflow.com/a/63935794/2096986
-
这个你搞定了吗? @sarvad123
标签: apache-flink prometheus metrics