diff --git a/.changelog/8564.txt b/.changelog/8564.txt new file mode 100644 index 000000000..2cb931f68 --- /dev/null +++ b/.changelog/8564.txt @@ -0,0 +1,3 @@ +```release-notes:improvement +cli: the `consul connect envoy --envoy_statsd_url` flag will now resolve the `$HOST_IP` environment variable, as part of a full url. +``` diff --git a/website/content/docs/connect/proxies/envoy.mdx b/website/content/docs/connect/proxies/envoy.mdx index cd9188588..f30b7fdbf 100644 --- a/website/content/docs/connect/proxies/envoy.mdx +++ b/website/content/docs/connect/proxies/envoy.mdx @@ -130,15 +130,17 @@ definition](/docs/connect/registration/service-registration) or ~> **Note:** currently the url **must use an ip address** not a dns name due to the way Envoy is setup for StatsD. + Expansion of the environment variable `HOST_IP` is supported, e.g. + `udp://${HOST_IP}:8125`. + Users can also specify the whole parameter in the form `$ENV_VAR_NAME`, which will cause the `consul connect envoy` command to resolve the actual URL from the named environment variable when it runs. This, for example, allows each pod in a Kubernetes cluster to learn of a pod-specific IP address for StatsD when the Envoy instance is bootstrapped while still allowing global configuration of all proxies to use StatsD in the [global `proxy-defaults` - configuration entry](/docs/connect/config-entries/proxy-defaults). The env variable must contain a full valid URL - value as specified above and nothing else. It is not currently possible to use - environment variables as only part of the URL. + configuration entry](/docs/connect/config-entries/proxy-defaults). The env + variable must contain a full valid URL value as specified above and nothing else. - `envoy_dogstatsd_url` - The same as `envoy_statsd_url` with the following differences in behavior: