1、在haproxy机器上部署haproxy_exporter,haproxy_exporter可到官网下载。

启动脚本如下:

[aiops@hadoop hadoop_exporter]$ more start_haproxy_exporter.sh
./haproxy_exporter --haproxy.scrape-uri="http://用户名:密码@localhost:1080/haproxy?stats;csv" &

2、获取各个租户的sts存活率:

round(haproxy_backend_current_server{instance="bigdata069042",backend="spark"} / 19 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_nlkf"} / 10 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_wxwy"} / 3 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_ghbb"} / 3 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_zdyx"} / 3 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_chn"} / 3 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_znfx"} / 2 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_dic_khxw"} / 2 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_stra_opr"} / 2 * 100)
round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_crm_bs"} / 2 * 100)

3、修改prometheus alter rule:

groups:
- name: general.rulesrules:- alert: eda sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark"} / 19 * 100)  <  101for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "eda sts available percent < 80%"value: '{{ $value }}'- alert: spark_nlkf sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_nlkf"} / 10 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_nlkf sts available percent < 80%"value: '{{ $value }}'- alert: spark_wxwy sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_wxwy"} / 3 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_wxwy sts available percent < 80%"value: '{{ $value }}'- alert: spark_ghbb sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_ghbb"} / 3 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_ghbb sts available percent < 80%"value: '{{ $value }}'- alert: spark_zdyx sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_zdyx"} / 3 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_zdyx sts available percent < 80%"value: '{{ $value }}'- alert: spark_chn sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_chn"} / 3 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_chn sts available percent < 80%"value: '{{ $value }}'- alert: spark_znfx sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_znfx"} / 2 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_znfx sts available percent < 80%"value: '{{ $value }}'- alert: spark_dic_khxw sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_dic_khxw"} / 2 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_dic_khxw sts available percent < 80%"value: '{{ $value }}'- alert: spark_stra_opr sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_stra_opr"} / 2 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_stra_opr sts available percent < 80%"value: '{{ $value }}'- alert: spark_crm_bs sts available percentexpr: round(haproxy_backend_current_server{instance="bigdata069042",backend="spark_crm_bs"} / 2 * 100) < 80for: 5mlabels:severity: warningannotations:summary: "{{ $labels.backend }} sts available percent < 80%"description: "spark_crm_bs sts available percent < 80%"value: '{{ $value }}'

使用Haproxy Exporter监控Sparkthrift存活率相关推荐

  1. 如何使用 Blackbox Exporter 监控 URL?

    前言 监控域名和 URL 是可观察性的一个重要方面,主要用于诊断可用性问题.接下来会详细介绍如何使用 Blackbox Exporter 和 Prometheus 在 Kubernetes 中实现 U ...

  2. GPE监控多台MySQL_GPE监控预警系统(Grafana+Prometheus+Exporter)搭建

    GPE监控预警系统结构图 一: Grafana 1:简介 大规模指标数据的可视化展现,是网络架构和应用分析中最流行的时序数据展示工具.目前已经支持绝大部分常用的时序数据库. Grafana支持许多不同 ...

  3. GPE监控预警系统搭建--Grafana+Prometheus+Exporter

    GPE监控预警系统(Grafana+Prometheus+Exporter) GPE监控预警系统结构图 一: Grafana的安装 1:简介 大规模指标数据的可视化展现,是网络架构和应用分析中最流行的 ...

  4. mysql exporter怎么配置_mysqld_exporter的源码分析和定制化(单个mysqld_exporter监控多个数据库实例)...

    mysqld_exporter是prometheus官方提供的用于监控mysql运行状态的exporter.其相关信息可以参考:https://github.com/prometheus/mysqld ...

  5. 【Prometheus】Exporter详解

    在 [Prometheus] Prometheus 入门到实战搭建监控系统 中为了采集主机的监控样本数据,我们在主机上安装了一个Node Exporter程序,该程序对外暴露了一个用于获取当前监控样本 ...

  6. 【Prometheus】 Prometheus 入门到实战搭建监控系统

    Prometheus (普罗米修斯)是一款基于时序数据库的开源监控告警系统,说起 Prometheus 则不得不提 SoundCloud,这是一个在线音乐分享的平台,类似于做视频分享的 YouTube ...

  7. 普罗米修斯 监控_接近完美的监控系统—普罗米修斯

    普罗米修斯(Prometheus)是一个SoundCloud公司开源的监控系统.当年,由于SoundCloud公司生产了太多的服务,传统的监控已经无法满足监控需求,于是他们在2012年决定着手开发新的 ...

  8. Exporter介绍与指标数据汇总(完结)

    1.exporter是什么 广义上讲所有可以向Prometheus提供监控样本数据的程序都可以被称为一个Exporter.而Exporter的一个实例称为target,如下所示,Prometheus通 ...

  9. Prometheus 监控基础

    Prometheus 监控基础 监控系统基础 监控系统发展史 SNMP监控时代 第一代主要是监控网络流量和网络设置为主的时代,在那个时代主要是通过SNMP协议监控交换机.路由器.网关.操作系统等,通过 ...

最新文章

  1. 异地多活场景下的数据同步之道 | 珍藏版
  2. 【tomcat】调整内存大小
  3. MySQL事务以及加锁机制
  4. (五)门级电路低功耗设计优化
  5. vue 调用mutation方法_Vuex白话教程第三讲:Vuex旗下的Mutation
  6. Hadoop入门(十六)Mapreduce的单表关联程序
  7. java邮件实例_java邮件小实例
  8. 前端学习(596):使用network waterfall分析页面载入性能
  9. 直流降压的简单方法_量血压的重大误区和简单的降压方法,尽快转告身边人!...
  10. C语言课后习题(55)
  11. mysql ---- 多表查询
  12. Vue.js 学习笔记 八 v-for
  13. leetcode刷题日记-846. 一手顺子
  14. 20 杭电计算机考研经验
  15. echarts 画正弦曲线
  16. [em] [/em] 表情 代码 如何使用 qq空间代码
  17. jq 下拉列表选中事件_JQuery select各种事件
  18. R语言模拟疫情传播-gganimate包
  19. LintCode 644. 镜像数字 JavaScript算法
  20. 闪电网络的核心概念:RSMC 和 HTLC

热门文章

  1. Android: Switch更改颜色
  2. 大白菜装机教程win10_电脑一键装机win10系统_win10教程
  3. 微信小程序: 预览pdf,ppt,word等文件
  4. Linux下调整屏幕分辨率
  5. 谁说NTFS不支持UEFI启动的?启动U盘放不了超过4G的文件怎么办?Server2016 Win10 U盘UEFI启动制作方法
  6. select函数到底该怎么用?
  7. 删除OneDrive for Bussiness导航栏快捷方式
  8. linux备份压缩tgz,linux关于解压和压缩命令 zip rar tar.gz tgz
  9. C++右值引用与函数返回值
  10. 图的生成树与生成森林