flink metrics 的作用
Flink 提供的 Metrics 可以在 Flink 内部收集一些指标,通过这些指标让开发人员更好地理解作业或集群的状态。由于集群运行后很难发现内部的实际状况,跑得慢或快,是否异常等,开发人员无法实时查看所有的 Task 日志,比如作业很大或者有很多作业的情况下,该如何处理?此时 Metrics 可以很好的帮助开发人员了解作业的当前状况。
1.flink metric的配置
单独在flink-yaml 中增加一列。
metrics.reporters: prom
metrics.reporter.prom.class: org.apache.flink.metrics.prometheus.PrometheusReporter
metrics.reporter.prom.port: 9250-9260
参考:
https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/deployment/metric_reporters/
https://www.jianshu.com/p/a91ebb9d8b74