prometheus服务发现

Consul简介

◼ 一款基于golang开发的开源工具,主要面向分布式,服务化的系统提供服务注册、服务发现和配置管理

的功能

◼ 提供服务注册/发现、健康检查、Key/Value存储、多数据中心和分布式一致性保证等功能

部署

bash 复制代码
curl -LO https://releases.hashicorp.com/consul/1.16.2/consul_1.16.2_linux_amd64.zip

unzip  consul_1.16.2_linux_amd64.zip



mv consul /usr/local/bin
consul agent -dev -ui -data-dir=/consul/data/ \
-config-dir=/etc/consul/ -client=0.0.0.0

访问

http://120.77.146.92:8500/

bash 复制代码
root@server01:/consul/data# vi /etc/consul/nodes.json 

{
"service": {
"id": "node_exporter",
"name": "node01",
"address": "172.29.21.67",
"port": 9100,
"tags": ["nodes"],
"checks": [{
"http": "http://172.29.21.67:9100/metrics",
"interval": "5s"
}]
}
}

基于consnl的服务发现

修改prometheus配置文件

注释file_sd_configs段

添加consul_sd_configs段

查看prometheus

之前labels的os标签没有了,这个是基于consnl发现的

相关推荐
oMcLin4 小时前
如何在 Rocky Linux 8.7 上通过 Prometheus 与 Grafana 结合,提升大规模容器环境的监控与性能分析?
linux·grafana·prometheus
飞翔沫沫情11 小时前
Prometheus 监控 ESXi 实战
grafana·prometheus·esxi·vcenter 监控·vsphere 监控
喵叔哟11 小时前
19.服务集成与通信
后端·docker·容器·服务发现
莫非王土也非王臣13 小时前
Prometheus监控多个网站状态并推送到企业微信群机器人的完整方案
机器人·企业微信·prometheus
goodlook01232 天前
监控平台搭建-日志-alloy篇(八)
grafana·prometheus
三不原则2 天前
实战:Prometheus 监控 GPU 使用率,设置智能告警阈值
prometheus
flying robot3 天前
Prometheus[2.33.3]grafana[12.3.1]监控安装
grafana·prometheus
一只懒鱼a6 天前
Prometheus和Grafana的安装和使用
grafana·prometheus
YanDDDeat6 天前
Prometheus + Grafana 搭建应用监控体系
java·后端·eureka·grafana·prometheus
goodlook01236 天前
监控平台搭建-日志-loki篇-最新版3.6.3(七)
服务器·grafana·prometheus