Prometheus
文章平均质量分 63
Prometheus学习
real向往
温故而知新
展开
-
Prometheus-使用python开发exporter
exporter有很多,但想要特定需求的话,还需自行开发。在这里使用python写一个exporter,用于监控/root下的目录数量。开发exporter需要使用prometheus_client库,具体规范可参考:https://github.com/prometheus/client_python ,根据规范可知要想开发一个exporter需要先1. 定义数据类型,metric,describe(描述),标签2. 获取数据3. 传入数据和标签4. 暴露端口,不断的传入数据和标签知道了开发原创 2021-04-20 22:36:14 · 5078 阅读 · 2 评论 -
Prometheus-中间件(nginx/mysql)监控
Mysql创建mysqld_exporter用户useradd -M -s /usr/sbin/nologin mysqld_exporter获取mysqld_exporter包, 解压并修改属主数组为mysqld_exporterwget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysqld_exporter-0.12.1.linux-amd64.tar.gztar xf mysql原创 2021-03-31 19:45:06 · 463 阅读 · 0 评论 -
Prometheus+Grafana系统指标监控
一、常见监控指标1.1 CPUCPU使用率(1-avg(irate(node_cpu_seconds_total{job="node_exporter",mode="idle"}[5m])) by (instance))*1001分钟负载node_load1{job="node_exporter"}5分钟负载node_load5{job="node_exporter"}15分钟负载node_load15{job="node_exporter"}1.2 内存如果要监控多个主机时原创 2021-02-28 18:37:04 · 1666 阅读 · 1 评论 -
Prometheus-PromQL常用函数了解
一、数据格式了解exporter暴漏的数据以下边的方式进行呈现# HELP node_filesystem_free_bytes Filesystem free space in bytes. #解释# TYPE node_filesystem_free_bytes gauge #数据类型node_filesystem_free_bytes{device="/dev/mapper/centos_test- root",fstype="xfs",mountpoint="/"} 1.1637821原创 2020-09-20 23:08:19 · 4917 阅读 · 0 评论 -
Prometheus-入门学习
Prometheus是由google研发的开源监控系统特点多维数据模型,数据以时间序列的方式进行存储(由时间戳、metric{label=value}和值组成)监控数据的精细程度高,可以精确到1~5秒的采集程度灵活的查询语句(PromQL)采用HTTP pull/push两种数据采集传输方式支持本地和远程存储良好的可视化,自带Prometheus UI,但对于数据可视化展示,最好使用grafana支持大量的客户端库。这些客户端库可用于暴露服务的相关指标,像nginx,tomcat等,pro原创 2020-09-20 00:51:01 · 4491 阅读 · 2 评论
分享