1、nacos配置
nacos默认是没有开启指标
配置application.properties文件,暴露metrics数据
management.endpoints.web.exposure.include=*
可尝试访问,如果返回数据则是正常
curl localhost:8848/nacos/actuator/prometheus
2、prometheus配置
- job_name: 'nacos-cluster'
scrape_interval: 60s
metrics_path: '/nacos/actuator/prometheus'
static_configs:
- targets:
- 10.0.0.100:8848
- 10.0.0.101:8848
- 10.0.0.102:8848
检查prometheus配置是否正常
./promtool check config prometheus.yml
网友评论