简体   繁体   English

Flink Prometheus Push Gateway Reporter - 删除作业关闭的指标

[英]Flink Prometheus Push Gateway Reporter - Delete Metrics on Job Shutdown

I have set up the PrometheusPushGatewayReporter as explained in the documentation metrics section.我已经按照文档指标部分中的说明设置了PrometheusPushGatewayReporter

I can see the metrics from the flink jobmanager and the taskmanagers exposed in the push gateway's UI, as well as that they are properly scraped by the Prometheus Cluster.我可以看到来自推送网关 UI 中公开的 flink 作业管理器和任务管理器的指标,以及它们被 Prometheus 集群正确抓取。

The issue is that even though I have explicitly set the deleteOnJobShutdown config option, only the jobmanager's metrics are deleted when the job is cancelled through the flink cli tool.问题是,即使我已经明确设置了deleteOnJobShutdown配置选项,当通过 flink cli 工具取消作业时,也只会删除作业管理器的指标。

Is there a way to also delete the stale taskmanager metrics?有没有办法也删除陈旧的任务管理器指标? My configuration is as follows :我的配置如下:

metrics.reporter.promgateway.class: org.apache.flink.metrics.prometheus.PrometheusPushGatewayReporter
metrics.reporter.promgateway.host: $PUSH_GATEWAY_HOST
metrics.reporter.promgateway.port: 80
metrics.reporter.promgateway.jobName: foo
metrics.reporter.promgateway.randomJobNameSuffix: true
metrics.reporter.promgateway.deleteOnShutdown: true
metrics.reporter.promgateway.interval: 60 SECONDS

I am using Flink 1.7.1, on Hadoop 2.6.0我在 Hadoop 2.6.0 上使用 Flink 1.7.1

. .

In our product env, we also met the same problem.在我们的产品环境中,我们也遇到了同样的问题。 If pushgateway can implements TTL for pushed metrics [1], it'll very useful.如果 pushgateway 可以TTL for pushed metrics实现TTL for pushed metrics [1],那将非常有用。 But for now, we use a external schedule system to check whether the flink job is alive or not, then delete metrics by pushgateway's rest api[2].但是现在,我们使用外部调度系统来检查 flink 作业是否处于活动状态,然后通过 pushgateway 的 rest api[2] 删除指标。

[1] https://github.com/prometheus/pushgateway/issues/19 [1] https://github.com/prometheus/pushgateway/issues/19

[2] https://github.com/prometheus/pushgateway#delete-method [2] https://github.com/prometheus/pushgateway#delete-method

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

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