Prometheus Scrape Config Builder

Generate a prometheus.yml with scrape jobs and alert manager config

Creates a valid prometheus.yml with global scrape and evaluation intervals, an Alertmanager target, rule-file globs, and one or more scrape jobs each with its own metrics path, scheme, interval override, and static targets.

What is the scrape_interval?

It is how often Prometheus pulls metrics from each target. The global value applies everywhere unless a job overrides it; 15 seconds is a common default balancing resolution against storage and load.

A scrape config Prometheus will actually load

Prometheus is only as useful as its prometheus.yml, and a single mis-indented line can stop the whole server starting. This builder produces a valid config from a form: global intervals, an Alertmanager target, rule-file globs, and as many scrape jobs as you need — each with its own path, scheme, and target list.

How it works

The output follows Prometheus’ configuration schema. The global block sets scrape_interval and evaluation_interval. An optional alerting block lists Alertmanager endpoints under static_configs, and rule_files holds your alert and recording-rule globs. Under scrape_configs, each job emits a job_name, an optional metrics_path (only when it differs from the default /metrics), an optional scheme for HTTPS, an optional per-job scrape_interval, and a static_configs targets list parsed from your comma- or space-separated entries. Proper two-space YAML indentation is handled for you so the file loads on first try.

Tips and example

  • Always include a job that scrapes Prometheus itself (localhost:9090) so you can monitor the monitor.
  • Use a per-job scrape_interval for heavy exporters — scraping a slow endpoint every 15 seconds can overload it.
  • Keep alert and recording rules out of this file and in the globs under rule_files; that separation keeps the config readable.
  • Validate the result with promtool check config prometheus.yml before reloading in production.