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发现的

相关推荐
core5121 天前
prometheus+grafana接入nginx实战
nginx·grafana·prometheus·监控·接入·vts·vtx
鼠鼠我捏,要死了捏5 天前
大规模集群下 Prometheus 监控架构实战经验分享
prometheus·monitoring·devops
山岚的运维笔记5 天前
AlpineLinux使用docker部署prometheus
docker·容器·prometheus
DaxiaLeeSuper5 天前
Prometheus+Grafana+node_exporter监控linux服务器资源的方案
linux·grafana·prometheus
core5127 天前
Grafana接入Prometheus实战
grafana·prometheus
奈斯ing7 天前
【prometheus+Grafana篇】PromQL核心函数解析:rate()与irate()函数详解
运维·grafana·prometheus
叹人间,美中不足今方信7 天前
gRPC服务发现
rpc·go·服务发现
Code季风7 天前
将 gRPC 服务注册到 Consul:从配置到服务发现的完整实践(上)
数据库·微服务·go·json·服务发现·consul
lingRJ7778 天前
从混沌到掌控:基于OpenTelemetry与Prometheus构建分布式调用链监控告警体系
java·springboot·prometheus·backend·opentelemetry·jaeger·microservices
码上淘金11 天前
【Prometheus 】通过 Pushgateway 上报指标数据
prometheus