栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

[metric]使用Prometheus监控flink1.13org.apache.flink.metrics

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

[metric]使用Prometheus监控flink1.13org.apache.flink.metrics

目录
  • 1 Prometheus安装使用
  • 2 pushgateway安装使用
  • 3 flink配置
  • Prometheus查看到如下指标

1 Prometheus安装使用

prometheus下载地址:
https://prometheus.io/download/
打开http://localhost:9090/就可以访问使用

2 pushgateway安装使用

解压后直接运⾏ ./prometheus 就可以启动 prometheus

prometheus pushgateway下载地址:
https://prometheus.io/download/

编辑Prometheus中的prometheus.yaml文件

- job_name: 'pushgateway'
 scrape_interval: 10s
 honor_labels: true #加上此配置exporter节点上传数据中的⼀些标签将不会被pushgateway节点的相同标签覆盖
 static_configs:
 - targets: ['192.168.xx.xxx:9095']
 labels:
 instance: pushgateway

因为prometheus配置pushgateway 的时候,也会指定job和instance,但是它只表示
pushgateway实例,不能真正表达收集数据的含义。所以配置pushgateway需要添加
honor_labels:true,避免收集数据本身的job和instance被覆盖

启动 pushgaterway

./pushgaterway --web.listen-address=192.168.xx.xxx:9095
3 flink配置
vi flink-conf.yaml

底部添加

metrics.reporter.promgateway.class: org.apache.flink.metrics.prometheus.PrometheusPushGatewayReporter
metrics.reporter.promgateway.host: 192.168.xx.xxx
metrics.reporter.promgateway.port: 9095
metrics.reporter.promgateway.jobName: wyJob
metrics.reporter.promgateway.randomJobNameSuffix: true
metrics.reporter.promgateway.deleteOnShutdown: false

启动 Flink,可以看到启动日志有端口号

Prometheus查看到如下指标

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/882420.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号