I found another service discovery that looks even better – dns_sd_config. As I understand it will find all node_exporter nodes automatically.
but when I added the three items needed to configure it to my prometheus.yml , I get this error when cycling prometheus:
“Error reloading config” err=“couldn’t load configuration (–config.file=“prometheus.yml”): parsing YAML file prometheus.yml: yaml: line 8: could not find expected ‘:’”
Here’s my prometheus.yml Line 8 is the “names”
global:
scrape_interval: 10s
evaluation_interval: 10s
#BEGIN DNS Node Scan
dns_sd_config
- names: pace.gatech.edu
# The type of DNS query to perform. One of SRV, A, or AAAA.
#[ type: <string> | default = 'SRV' ]
# The port number used if the query type is not SRV.
- port: 9100
- refresh_interval: 1800
#END DNS Node Scan
I get the same error if I format names: like so (on two lines)
- names:
pace.gatech.edu