Support dynamic addresses for envoy proxy statsd_url configurations #8561
Labels
theme/kubernetes
Consul-helm/kubernetes related questions
theme/telemetry
Anything related to telemetry or observability
Feature Description
Either/or:
This would provide a way to make use of the
$ENV_VAR_NAME
configuration option specified here: (https://www.consul.io/docs/connect/proxies/envoy#envoy_statsd_url)Use Case(s)
envoy_statsd_url
andenvoy_dogstatsd_url
must take an ip address and not a hostname. This presents problems when using daemonset statsd agents, because the config for each proxy must point to the localHOST_IP
. The Connect Inject workflow does not provide any method to dynamically inject the appropriate address into the statsd_url configurations.While the
consul connect enoy
command supports reading the entire config value from an environment variable, there's no meaningful way to populate such a variable in the injection sidecar container. The environment variableHOST_IP
is already present in the container, but the dynamic env var configuration option requires that the target env var contain the entire configuration url, e.g.udp://ip:port
.The code here could be updated to support expanding environment variables in the config string. I believe this option would be the easiest to implement and I'd be happy to submit a PR with the changes. My only concern is if there was a reason this functionality was explicitly considered yet not implemented initially. From the docs: "It is not currently possible to use environment variables as only part of the URL." If there's a security concern or something, perhaps maintaining an allowlist of accepted env vars would be sufficient, e.g. only allow expansion of
HOST_IP
.Alternatively, providing the ability to pass additional arbitrary env vars into the inject container would allow users to leverage the intended dynamic environment config option for these settings. This seems pretty messy and involved.
The text was updated successfully, but these errors were encountered: