dokku-graphite
dokku-graphite copied to clipboard
Docker expose uses TCP for all ports, but 8125 needs UDP
I've installed the plugin and tryed to expose the port of StatsD to use it from a non containerized app on another host.
The ambassador container starts correctly but expose the 8125 port using TCP and not UDP, is it possibile to have StatsD port exposed as UDP?
Bump - also facing this issue. Can't access StatsD externally due to this, resorted to a bit of a hack messing with docker.
EDIT: The fix would probably be by modifying this line to do this.
I'd do a push request but my bash skills are practically nonexistent. :P
UPDATE: I found a temporary workaround to the problem, although it's quite involved.
- Unexpose the Graphite ports.
- Expose them, but set the StatsD port to a different port than usual. In my case, I set it to 8120.
- Get the Docker internal IP for the non-ambassador Graphite docker instance.
- Set up a socat pipe to redirect the UDP traffic to the Docker Graphite instance.
# Get the IP for the non-ambassador Docker container
sudo docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a
# Inspect that container, find its IP
sudo docker inspect c28099211a37 | grep IPAddress
# Setup a socat proxy to redirect UDP traffic from 8125 on the host to 8125 on non-ambassador Graphite
sudo docker run -d --rm -p 8125:1234/udp verb/socat:alpine -d -d UDP4-LISTEN:1234,reuseaddr,fork UDP4:172.17.0.6:8125