Skip to content

Instantly share code, notes, and snippets.

@clofresh
Last active December 30, 2015 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clofresh/7883109 to your computer and use it in GitHub Desktop.
Save clofresh/7883109 to your computer and use it in GitHub Desktop.
Hack to enable dogstatsd debug logging

We don't have debug logging in dogstatsd as it can potentially receive a huge amount of data and logging the incoming udp packets will kill cpu/disk. Sometimes we need to see that data though when trying to debug dogstatsd submission, so here is a hacky way to do it.

To apply it:

cd /
curl https://gist.github.com/clofresh/7883109/raw/75718cf42179d2199643daeea47fcec387e42281/dogstatsd_debug.py.patch | sudo patch -p 0
sudo service datadog-agent restart

To undo it:

cd /
curl https://gist.github.com/clofresh/7883109/raw/75718cf42179d2199643daeea47fcec387e42281/dogstatsd_debug.py.patch | sudo patch -p 0 -R
sudo service datadog-agent restart
--- /usr/share/datadog/agent/dogstatsd.py 2013-11-25 21:25:21.000000000 +0000
+++ /usr/share/datadog/agent/dogstatsd_debug.py 2013-12-09 23:26:36.000000000 +0000
@@ -254,6 +254,7 @@
ready = select_select(sock, [], [], timeout)
if ready[0]:
message = socket_recv(buffer_size)
+ log.info(message)
aggregator_submit(message)
if should_forward:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment