Prometheus简介
Prometheus是一个开源的系统监控和报警的工具包,最初由SoundCloud发布,后经过开源社区慢慢发展壮大。其本身并不具备监控功能,
但是依靠其周边组件而具备强大的监控功能。可以对服务器硬件,系统,应用以及容器进行监控告警。
Prometheus的主要特点有:
多维数据模型(有metric名称和键值对确定的时间序列)
灵活的查询语言
不依赖分布式存储
通过pull方式采集时间序列,通过http协议传输
支持通过中介网关的push时间序列的方式
监控数据通过服务或者静态配置来发现
支持图表和dashboard等多种方式
Prometheus包含多个组件,其中有许多是可选的:
Prometheus主服务器,用来收集和存储时间序列数据
应用程序client代码库
短时jobs的push gateway
基于Rails/SQL的GUI dashboard
特殊用途的exporter(包括HAProxy、StatsD、Ganglia等)
用于报警的alertmanager
命令行工具查询
cadvisor用来收集容器信息
依赖Docker
Debian上安装docker
1:apt-get remove docker docker-engine docker.io
2:apt-get update
3:apt-get install apt-transport-https ca-certificates curl software-properties-common
4:curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
5:apt-key fingerprint 0EBFCD88
6:add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable”
7:apt-get update
8:apt-get install docker-ce
9:systemctl start docker
或者Redhat安装docker
1:yum -y install docker-ce