[!NOTE]
The repository has been renamed from prometheus-configs-provider
to prometheus-config-provider
.
About
This is a simple tool that reads the Docker API and generates Prometheus scrape configs for all Docker configs that have the io.prometheus.scrape_config
label set to true
.
Usage
usage: prometheus-configs-provider [<flags>]
Flags:
--[no-]help Show context-sensitive help (also try --help-long and --help-man).
--output-dir="/etc/prometheus/configs"
directory for the configs
--output-ext="yaml" extension for the configs
--[no-]keep-existing keep existing files in output directory
--evaluation-interval=15s How frequently to evaluate service configs
--prometheus-scrape-config-label="io.prometheus.scrape_config"
label to identify prometheus scrape configs
--[no-]version Prints current version.
--[no-]short-version Print just the version number.
Example
# docker-stack.yml
configs:
example-scrape-config:
file: ./example-scrape-config.yaml
labels:
- "io.prometheus.scrape_config=true"
With the help of the prometheus-operator/prometheus-operator/tree/main/cmd/prometheus-config-reloader tool, we can automatically reload the Prometheus configuration when the Docker configs are create/update/remove.
License
Licensed under MIT.