prometheus-config-builder can be used to build main prometheus.yaml and related rules yaml files from a combination of different sources such as files in S3 buckets.

It also supports some extended ways to build scrape_configs such as fetching AWS ECS service endpoints.


1) Install via Rubygems:

$ gem install prometheus-config-builder

2) Create a prometheus.yaml to be used as a base template

3) Create one or more source yaml files (See test/data/test*.yaml as examples) to be included into your prometheus configuration.

4) Start the program: prometheus-config-builder --prometheus-src=test/data/prometheus.yaml --dst-dir=tmp --path=test/data/test*.yaml

The program will re-create the config files every n seconds. If you set --pgrep=[STRING] it will try to find your Prometheus instance pid and send a SIGHUP to Prometheus so that it reloads new configurations. Try the --pgrep search string with "pgrep -f [STRING]" to be use you will get just one correct result.