What is service discovery in Prometheus?
BeginnerConceptPrometheus Architecture
Answer
Instead of static target lists, Prometheus asks a source of truth for targets and refreshes them automatically. Built-in mechanisms include kubernetes_sd_configs, ec2_sd_configs, consul_sd_configs, azure_sd_configs, gce_sd_configs, dns_sd_configs, file_sd_configs and http_sd_configs.
Discovered targets come with __meta_* labels (tags, pod labels, namespace) that you use in relabeling to filter and label them. Check the result at /targets and /service-discovery in the UI.
More on Prometheus Architecture
Describe the Prometheus architecture.BeginnerWhat does a basic prometheus.yml look like?BeginnerWhat is the `up` metric?BeginnerWhat are `job` and `instance` labels and where do they come from?BeginnerHow is the Prometheus TSDB organized on disk?AdvancedWhat is the WAL and why does Prometheus restart slowly sometimes?Advanced