我正在通过prometheus Flink metrics Reporter向Prometheus发送自定义应用程序指标。指标创建正确,因为我能够在flink仪表板中准确地看到它们。我配置了类似于found here的prometheus metrics reporter。当我转向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: 9090promethus.yml:
scrape_configs:
- job_name: 'flink'
static_configs:
- targets: ['localhost:9090']我是否在配置中遗漏了什么?为什么我的集群指标到达prometheus,而不是我的自定义指标?
发布于 2021-09-17 15:17:12
Hi @sarvad123可能(取决于你的Flink版本)你应该在/lib文件夹中添加flink-metrics-prometheus-{version}.jar。
https://stackoverflow.com/questions/68687300
复制相似问题