Pipes should be escaped or replaced before sending to datadog #6
Description
Hi,
This is how I'm using connect-datadog in my app:
var connectDatadog = require('connect-datadog');
app.use(connectDatadog({response_code: true, path: true, method: true}));
I've noticed that my syslogs are filling up with errors like this:
ERROR (dogstatsd.py:309): Error receiving datagram#012Traceback (most recent call last):#12 File "/opt/datadog-agent/agent/dogstatsd.py", line 297, in start#012 aggregator_submit(message)#12 File "/opt/datadog-agent/agent/aggregator.py", line 606, in submit_packets#012 parsed_packets = self.parse_metric_packet(packet)#12 File "/opt/datadog-agent/agent/aggregator.py", line 481, in parse_metric_packet#012 raise Exception('Metric value must be a number: %s, %s' % (name, raw_value))#012Exception: Metric value must be a number: node.express.router.response_code.all, url(api
I've got some javascript files missing obviously, but I didn't think this should be causing syslog errors. I wrote some more information out of /opt/datadog-agent/agent/aggregator.py and here is the packet that is being passed through to be parsed, as well as the associated error:
Packet:node.express.router.response_code.404:1|c|#route:/:url(api|components|app|bower_components|assets)/*,method:get,path:/app/shims/combos/1.js,response_code:404
Error: Metric value must be a number: node.express.router.response_code.404, url(api
aggregator.py does state that the schema of a dogstatsd packet is expected like this:
<name>:<value>|<metric_type>|@<sample_rate>|#<tag1_name>:<tag1_value>,<tag2_name>:<tag2_value>:<value>|<metric_type>...
For some reason it looks like the parser is seeing url(api
as the value for node.express.router.response_code.404
.
I'm not sure where the actual error is, but the parser is choking on these types of packets.
Thanks