From c92d1fdf8e498633b1e5ede0c5743673b6636f99 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 26 Oct 2022 01:54:13 +0300 Subject: [PATCH] docs/Cluster-VictoriaMetrics.md: update docs about env vars usage in command-line flags This is a follow-up for 02096e06d020b1828c285ca68b16074d2e6d03c3 --- README.md | 7 ++++++- docs/Cluster-VictoriaMetrics.md | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0fd1d157ba..34733ff21d 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,12 @@ It is possible manualy setting up a toy cluster on a single host. In this case e ### Environment variables -Each flag values can be set through environment variables by following these rules: +All the VictoriaMetrics components allow referring environment variables in command-line flags via `${ENV_VAR}` syntax. +For example, `-metricsAuthKey=%{METRICS_AUTH_KEY}` is automatically expanded to `-metricsAuthKey=top-secret` +if `METRICS_AUTH_KEY=top-secret` environment variable exists at VictoriaMetrics startup. +This expansion doesn't need any special shell - it is performed by VictoriaMetrics itself. + +Additionally, all the VictoriaMetrics components allow setting flag values via environment variables according to these rules: - The `-envflag.enable` flag must be set - Each `.` in flag names must be substituted by `_` (for example `-insert.maxQueueDuration ` will translate to `insert_maxQueueDuration=`) diff --git a/docs/Cluster-VictoriaMetrics.md b/docs/Cluster-VictoriaMetrics.md index f48e33fe52..2f316ab9ef 100644 --- a/docs/Cluster-VictoriaMetrics.md +++ b/docs/Cluster-VictoriaMetrics.md @@ -184,7 +184,12 @@ It is possible manualy setting up a toy cluster on a single host. In this case e ### Environment variables -Each flag values can be set through environment variables by following these rules: +All the VictoriaMetrics components allow referring environment variables in command-line flags via `${ENV_VAR}` syntax. +For example, `-metricsAuthKey=%{METRICS_AUTH_KEY}` is automatically expanded to `-metricsAuthKey=top-secret` +if `METRICS_AUTH_KEY=top-secret` environment variable exists at VictoriaMetrics startup. +This expansion doesn't need any special shell - it is performed by VictoriaMetrics itself. + +Additionally, all the VictoriaMetrics components allow setting flag values via environment variables according to these rules: - The `-envflag.enable` flag must be set - Each `.` in flag names must be substituted by `_` (for example `-insert.maxQueueDuration ` will translate to `insert_maxQueueDuration=`)