Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Pipes should be escaped or replaced before sending to datadog #6

Description

@hurricane766

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions