On 25/06/2020 12:18, pratyu...@gmail.com wrote:
If my node instances (IP address) gets dynamically changed then how can it be automatically updated in service discovery so that prometheus can reload the changed instances on specified refresh interval. How can we do that (automatically updating changed instances in service discovery) in consul_sd_config, file_sd_config and ec2_sd_config? Which service discovery (consul, file, ec2) would be easier to handle in that case?

It really depends what you are doing for service discovery currently. Do you use Consul or EC2 instances at the moment?

IP addresses don't generally change once a node is running. Consul would generally be configured to register services on node (or service) startup.

As soon as Consul is updated Prometheus will see the new node (as well as stopping scraping any removed nodes). The same is true for EC2 - new instances will be reflected straight away in the scrape list.

The file SD is slightly different. While any change to that file will be immediately seen by Prometheus it is up to you to change the file. Popular methods include cron jobs, sidecar services or configuration management tools. How quickly things change is then up how often those additional tools run and discover differences. This is also dependent on where the information is coming from & how often that is refreshed.

--
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/d8222ecc-93ff-fc70-0ac9-6b98805f2da0%40Jahingo.com.

Reply via email to