-
Notifications
You must be signed in to change notification settings - Fork 34
parse metric name and tags with histograms support #81
base: master
Are you sure you want to change the base?
Conversation
Thanks for the report / fix + test! I'll check on this tomorrow morning (I'm CST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to move your logic for parsing the bin_
suffix out to here https://github.com/librato/statsd-librato-backend/blob/master/lib/librato.js#L377? I would prefer to keep parseAndSetTags
focused on just parsing tags out and keep timer-specific logic contained inside here: https://github.com/librato/statsd-librato-backend/blob/master/lib/librato.js#L343
For timers and their suffixes (p99, etc), we handle similar logic with tags inside the function called here https://github.com/librato/statsd-librato-backend/blob/master/lib/librato.js#L365.
Other than that, looks great!
cc @jderrett |
@@ -62,6 +62,22 @@ module.exports = { | |||
this.emitter.emit('flush', 123, metrics); | |||
}, | |||
|
|||
testValidMeasurementSingleTagFromHistogram: function(test) { | |||
test.expect(4); | |||
let metrics = {gauges: {'my_gauge#foo=bar.bin_50': 1}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good test but we probably want to build a proper timer
metric to fully test this code path: https://github.com/librato/statsd-librato-backend/blob/master/lib/librato.js#L373.
Something like https://github.com/librato/statsd-librato-backend/blob/master/test/librato_tests.js#L85-L94 but with a histogram
property
@mugurax No worries! You can make the change on your branch and update the PR. |
Any updates? |
@bryanmikaelian any update here? I would happily take this over otherwise. |
cc @mbeale . You ok with @johanneswuerbach taking this over? I can try to get it knocked out but no ETA. Is this something Librato still wants to support? |
@bryanmikaelian probably ok for @johanneswuerbach to take over. I'm not sure if Librato will release another version. |
When sending timers with histograms, statsd creates new gauges with .bin_x added to the original metric name.
For instance: global-prefix.name#tag=val is sent to statsd-librato-backend as global-prefix.name#tag=val.bin_50
This format is not supported by the existing parseAndSetTags.
Thanks,
Mugur