前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用prometheus监控hudi相关指标

使用prometheus监控hudi相关指标

作者头像
从大数据到人工智能
发布2022-01-19 08:23:44
1K0
发布2022-01-19 08:23:44
举报
文章被收录于专栏:大数据-BigData

前提

首先请安装好prometheus、pushgateway以及grafana,如果还没安装请参考:

hudi相关指标进行监控,只需要在将数据写入hudi的时候进行监控配置即可,本文以Flink SQL Client实战CDC数据入湖为例,对其指标进行监控。

基本环境介绍

本文使用的prometheus、pushgateway以及grafana的地址和端口分别为:

  • promotheus:hadoop1:9090
  • pushgateway:hadoop1:9091
  • grafana:windows安装的程序,直接接入prometheus数据

本文使用的示例与Flink SQL Client实战CDC数据入湖文章所述基本一致,只是在创建hudi目标表有所不同,并且原来的表名为stu3全部换成stu6。下文直接描述如何创建带有监控参数的hudi目标表。

创建带有监控参数的hudi目标表

代码语言:javascript
复制
 create table stu6_binlog_sink_hudi(
  id bigint not null,
  name string,
  `school` string,
  nickname string,
  age int not null,
  class_num int not null,
  phone bigint not null,
  email string,
  ip string,
  primary key (id) not enforced
)
 partitioned by (`school`)
 with (
  'connector' = 'hudi',
  'path' = 'hdfs://hadoop:9000/tmp/stu6_binlog_sink_hudi',
  'table.type' = 'MERGE_ON_READ',
  'write.option' = 'insert',
  'write.precombine.field' = 'school',
  'hoodie.metrics.on' = 'true',
  'hoodie.metrics.executor.enable' = 'true',
  'hoodie.metrics.reporter.type' = 'PROMETHEUS_PUSHGATEWAY',
  'hoodie.metrics.pushgateway.job.name' = 'hudi-metrics',
  'hoodie.metrics.pushgateway.host' = 'hadoop1',
  'hoodie.metrics.pushgateway.report.period.seconds' = '10',
  'hoodie.metrics.pushgateway.delete.on.shutdown' = 'false',
  'hoodie.metrics.pushgateway.random.job.name.suffix' = 'false'
  );Copy

相比原文,本问在创建hudi目标表时候新增了hoodie.metrics._相关指标,具体指标含义可参考:hudi监控指标介绍

相关指标查看

从上述步骤中,我们可以看到其数据写入模式为insert,那么我们打开pushgateway,可以看到如下指标:

prometheus中可以看到:

而grafana通过接入prometheus中的数据,可进行展示:

而当数据停止写入到hudi中时,下述指标中的红线后部分,我们可以发现其趋于稳定:

注意事项

某些指标在刚开始数据写入的时候并没有上报,需要等待一段时间。

本文为从大数据到人工智能博主「xiaozhch5」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://cloud.tencent.com/developer/article/1936511

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-11-,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前提
  • 基本环境介绍
  • 创建带有监控参数的hudi目标表
  • 相关指标查看
  • 注意事项
相关产品与服务
大数据
全栈大数据产品,面向海量数据场景,帮助您 “智理无数,心中有数”!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档