简体   繁体   English

自定义 Flink - Prometheus 指标

[英]Customize Flink - Prometheus metrics

I need to export custom metrics from Flink 1.10 to Prometheus.我需要将自定义指标从 Flink 1.10 导出到 Prometheus。 I have my custom metrics already created and working, but the issue is that when I print out (in terminal for example) to see the metrics, a lot of metrics comes out from Flink and I don't need them, such as: flink_taskmanager_job_task_Shuffle_Netty_Input_Buffers_inputQueueLength, and many more.我的自定义指标已经创建并正在工作,但问题是当我打印出来(例如在终端中)查看指标时,很多指标来自 Flink,我不需要它们,例如:flink_taskmanager_job_task_Shuffle_Netty_Input_Buffers_inputQueueLength , 还有很多。 I'm just interest into spread from Flink my custom metrics to Prometheus, and remove the rest of them.我只是对从 Flink 将我的自定义指标传播到 Prometheus 感兴趣,并删除其中的 rest。 So, questions:所以,问题:

  1. Is there anyway to remove all the metrics exported from Flink and just keep my custom metrics to Prometheus?无论如何要删除从 Flink 导出的所有指标并将我的自定义指标保留给 Prometheus?
  2. Is there anyway to create statics task_id to not accumulate a lot of information in Prometheus?无论如何要创建静态task_id,以免在Prometheus中积累大量信息? Because I supposed that that ids are not fixed and with every changes in the application that requires a stop/start, Flink will create a new task_id.因为我认为这些 id 不是固定的,并且应用程序中的每一次更改都需要停止/启动,所以 Flink 将创建一个新的 task_id。

I've been able to remove a few tags using: "metrics.reporter.cep_reporter.scope.variables.excludes":"job_id;job_name;task_attempt_id;task_attempt_num;task_name;operator_id;operator_name;subtask_index;tm_id;host;Netty"我已经能够使用以下方法删除一些标签:“metrics.reporter.cep_reporter.scope.variables.excludes”:“job_id;job_name;task_attempt_id;task_attempt_num;task_name;operator_id;operator_name;subtask_index;tm_id;host;Netty”

but is not enough, there are more than 800 metrics that I don't need, JVM for example, I'm using another node_exporter to scrape those metrics, need to remove this metrics too.但还不够,我不需要 800 多个指标,例如 JVM,我正在使用另一个 node_exporter 来抓取这些指标,也需要删除这些指标。

Any help will be appreciated.任何帮助将不胜感激。 Thanks a lot.非常感谢。

Disclaimer: I haven't tried this.免责声明:我没有尝试过这个。

What I would try would be to set a user scope on your custom flink metrics, and then configure prometheus to only scrape those metrics .我会尝试在您的自定义 flink 指标上设置用户 scope ,然后将 prometheus 配置为仅抓取这些指标

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

相关问题 Prometheus 没有显示 flink 指标 - Prometheus not showing flink metrics Flink 指标的 Prometheus 查询示例 - Prometheus Query example for Flink metrics 如何使用Prometheus指标监控Grafana中的Flink背压 - How to monitor Flink Backpressure in Grafana with Prometheus metrics 无法将 Flink 指标公开给 Prometheus - Can't expose Flink metrics to Prometheus 为什么我无法在Prometheus仪表板上查看Flink指标? - Why I cannot view the Flink metrics on the Prometheus dashboard? 如何将flink任务或Back Pressure相关指标导出到prometheus? - How to export flink task or Back Pressure related metrics to prometheus? Flink Prometheus Push Gateway Reporter - 删除作业关闭的指标 - Flink Prometheus Push Gateway Reporter - Delete Metrics on Job Shutdown Apache Flink 在 UI 中显示自定义指标,但普罗米修斯指标报告者没有抓取它们 - Apache Flink showing custom metrics in UI, but prometheus metrics reporter not scraping them 使用 PrometheusPushGateway 报告 flink 指标时从 prometheus 获取代码 '200' - Get code '200' from prometheus when using PrometheusPushGateway to report flink metrics 为什么 Flink 使用 Pushgateway 而不是 Prometheus 通常的 pull 模型进行一般指标收集? - Why Flink uses the Pushgateway instead of Prometheus's usual pull model for general metrics collection?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM