-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Describe the bug
Due to the 127.0.0.1 binding here, StatsD metrics are failing to send when CUBESTORE_METRICS_ADDRESS is set to something other than localhost.
This is expected Rust behavior as written here:
Note that bind declares the scope of your network connection. You can only receive datagrams from and send datagrams to participants in that view of the network. For instance, binding to a loopback address as in the example above will prevent you from sending datagrams to another device in your local network.
Suggested fix is changing the binding to 0.0.0.0 instead.
To Reproduce
Steps to reproduce the behavior:
- Run cubestore and with CUBESTORE_METRICS_ADDRESS set to non-localhost, we used a proxy container in docker that prints received UDP data.
- on startup, cubestore should send metric
cs.startup
, but instead will silently fail.
Note, we also ran a snippet of just the relevant code to be able to call init_metrics()
and confirmed with init_metrics("127.0.0.1:0",...)
and non-localhost CUBESTORE_METRICS_ADDRESS, rust will panic with called
Result::unwrap()on an
Err value: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }
.
However with init_metrics("0.0.0.0:0",...)
, metrics were able to be sent.
Expected behavior
With CUBESTORE_METRICS_ADDRESS set to address that is not localhost, StatsD metrics are still being sent.
Screenshots
N/A
Minimally reproducible Cube Schema
N/A
Version:
All current versions.
Additional context