Simple logger for StatsD metrics, adapted from http://lee.hambley.name/2013/01/26/dirt-simple-statsd-server-for-local-development.html to make it easier to debug metrics in development. Beyond converting it from Ruby to Go, also add colour output and rendering of DogStatsd tags.
It will also listen for Datadog APM traces and log them out.
go get -u github.com/catkins/statsd-logger/cmd/statsd-logger
statsd-logger
# send it some metrics using a library or (low-tech) netcat
echo -n "my.awesome_counter:1|c#cool:tags,another_tag:with_value" | nc -u -w0 localhost 8125
statsd-logger
can also log StatsD metrics being being sent to udp:8125 on running docker
containers without modification.
# log metrics for container named "myapp"
docker run --rm -it --net="container:myapp" catkins/statsd-logger
The MIT License
Copyright 2017 Chris Atkins