nacos
nacos copied to clipboard
nacos uses 'http_sd_configs' which is not well adapted to prometheus
Describe the bug Prometheus uses the http_sd_configs method, and the labels field in its protocol does not support the symbols . and -
#Nacos #http://127.0.0.1:8848/nacos/prometheus http return [{"targets":["192.168.31.20:9084"],"labels":{"preserved.register.source":"SPRING_CLOUD"}}]
#prometheus.yml scrape_configs:
- job_name: 'nacos-public'
http_sd_configs:
- url: http://127.0.0.1:8848/nacos/prometheus
#prometheus run log ts=2024-06-09T18:29:25.243Z caller=refresh.go:80 level=error component="discovery manager scrape" discovery=http config=nacos-public msg="Unable to refresh target groups" err=""preserved.register.source" is not a valid label name"