Support sources for increment and timing.#5
Conversation
|
+1 for sources. potentially this should be closer to the librato-rails signature, which would be more like: librato.increment('cpu_usage', {source: 'web.production.11'});
librato.timing('queues.timelag', 234.67, {source: 'worker.staging.2'}); |
|
+1 to that syntax. @crito @josephruscio I know it's been almost a year, so LMK if either of you do or don't plan to update this PR. |
|
I have to say I like the terse syntax of the original pull request. I'm not a big fan of stuffing function arguments into objects, it feels rather bloated to me. But thats my personal opinion and taste. How about making variadic functions out of |
|
I still prefer the options hash style for clarity and parity with the ruby On Wed, Feb 18, 2015 at 2:04 PM, crito notifications@github.com wrote:
|
|
Fair enough. If you'd like I could rework the original PR with the new syntax in the next days. |
|
That'd be awesome, thank you! On Wed, Feb 18, 2015 at 2:55 PM, crito notifications@github.com wrote:
|
|
+++! |
|
A new PR can be found at #24. |
For my use case, I needed to support sources for librato metrics.I could only find a global configuration option to do so. I tried to be as non intrusive as possible. If you want to supply a source to your metric use the following format:
Everything after the
;will be regarded as the source. If no source is supplied its simply ignored. If the metric itself provides a source, than that takes precedence over the global configured one. This does what I need it for. Maybe its useful for others too.