DataDog / dogstatsd-ruby

A Ruby client for DogStatsd
https://www.datadoghq.com/
MIT License
179 stars 137 forks source link

Support for TCP #256

Closed aflansburg closed 2 years ago

aflansburg commented 2 years ago

I am unsure of the level of difficulty or even the possibility of allowing transport over TCP, but our type of infrastructure does not allow for any open UDP ports for security reasons. Additionally, our stats agent lives in a separate host container from our applications so we're unable to directly leverage UDS.

We may be an edge-case, but I'm happy to look into this / contribute if this functionality being available is reasonable.

djmitche commented 2 years ago

Hi, thanks! The DogStatsD server only supports UDP and UDS (or named pipes on Windows), not TCP -- so that would be a server-side change.

I'm not sure what you mean by "host container", but if the agent and applications are in different containers on the same host, then you could potentially mount the UDS socket in both containers. We don't recommend running the agent and app on different hosts, as the metrics are tagged with the host running the agent.

aflansburg commented 2 years ago

Yup - realized after I posted here would need to implement a TCP listener in the host agent. Yeah our infrastructure is a bit different - we don't directly control our deploys of our images so we can't guarantee the host agent is on the same host. I know it sounds weird 😁

Sorry "host containers" was just poor articulation. The IaaS we use deploys our apps and services into multiple containers on AWS enclave.

djmitche commented 2 years ago

Hm, that's a tricky spot, then. I can imagine some workarounds, such as forwarding the UDS socket with something like socat, but those might not be great choices, either. Please contact our support who can dig into the particulars of the situation and determine the best solution.