Prometheus服务发现配置的方法主要有两种:
示例:
static_configs:
- targets: ['localhost:9090', 'example.com:8080']
示例:
- job_name: 'myapp'
consul_sd_configs:
- server: 'consul.service.consul:8500'
services: ['myapp']
通过以上两种方法,用户可以方便地配置Prometheus来监控目标主机,实现服务发现和监控。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:prometheus动态配置的方法是什么