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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus Architecture