Prometheus-监控系统

本文详细介绍了Prometheus监控系统的环境搭建,包括下载、解压、配置、启动及安装node_exporter。还探讨了数据存储类型如Counter、Summary、Gauge和Histogram,并介绍了Prometheus的基础架构和HTTP API的使用。同时提供了源码pom导入的指导。

Prometheus(普罗米修斯)概述

prometheus:Prometheus是一套开源的监控&报警&时间序列数据库的组合,起始是由SoundCloud公司开发的。

非常少的外部依赖+系统集成(docker Nginx JMX等),安装操作简单服务自动化发现,实现一种Profiling监控方式,实时分析系统运行的状态、执行时间、调用次数等,以找到系统的热点,为性能优化提供依据。

环境搭建

(1)下载prometheus

解压-由于普罗米修斯还将自己的数据公开为HTTP端点,因此可以对其自身的健康状况进行刮擦和监视。

http:// localhost:9090 进行监控,验证自身度量标准http:// localhost:9090 / metrics(其他端口后面加/metrics即可)。
下载地址https://prometheus.io/download/

(2)解压Prometheus
tar xvfz prometheus-*.tar.gz
cd prometheus-*
./prometheus --help(查看帮助文档)
(3)配置prometheus.yml

YAML 的数据组织主要依靠的是空白,缩进,分行等结构实现配置
在线YAML编辑器https://www.bejson.com/validators/yaml_editor/

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'tomcat'
    # metrics_path defaults to '/metr
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值