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

20 篇文章 3 订阅
4 篇文章 0 订阅

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查看到如下指标

在这里插入图片描述

在这里插入图片描述

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值