segmentio / stats

Go package for abstracting stats collection
https://godoc.org/github.com/segmentio/stats
MIT License
208 stars 32 forks source link

optinally allow http path tags in datadog client #50

Closed achille-roussel closed 7 years ago

achille-roussel commented 7 years ago

Historically we disabled the http_req_path tag that the httpstats package sets on metrics because there were cases where we had paths that embedded user IDs with a cardinality higher than what datadog can handle.

However there are cases where we have more control over what the HTTP requests path looks like, which means we could leverage the tag in those cases.

This PR makes it possible to lift the restriction on the http_req_path.

f2prateek commented 7 years ago

The Boolean flag thing sounds great for the simple case. I wonder if it's a good idea to accept a callback function that is provided the http path, and returns a tag ("" for no tag) or tags (nil for no tags).

achille-roussel commented 7 years ago

The callback option sounds good, I'll revisit this 👍