diff --git a/README.md b/README.md index c15825d..7a781df 100644 --- a/README.md +++ b/README.md @@ -756,7 +756,6 @@ In order for Telegraf to serve a [Prometheus](https://prometheus.io) endpoint, t | Variable | Description | | ------------------- | ------------------------------------------------------------------------ | | `PROMETHEUS_ENABLE` | Set to `true` for a Prometheus endpoint on `http://0.0.0.0:9273/metrics` | -| `PROMETHEUSPORT` | TCP port for the Prometheus endpoint. Default value is 9273 | ## Minimalist setup diff --git a/rootfs/etc/s6-overlay/startup.d/99-prometheus-conf b/rootfs/etc/s6-overlay/startup.d/99-prometheus-conf new file mode 100755 index 0000000..a866d24 --- /dev/null +++ b/rootfs/etc/s6-overlay/startup.d/99-prometheus-conf @@ -0,0 +1,27 @@ +#!/command/with-contenv bash +#shellcheck shell=bash disable=SC1091 + +source /scripts/common + +if ! chk_enabled "$PROMETHEUS_ENABLE"; then + exit 0 +fi + +# serve port 9274 always replying with stats.prom regardless of requested path + +cat > /etc/nginx/sites-enabled/prometheus_9274 <