librato / librato-metrics

Ruby wrapper to make it easy to interact with Librato's API.
https://librato.com
Other
108 stars 51 forks source link

Support a default source for measurements #106

Closed jderrett closed 9 years ago

jderrett commented 9 years ago

We received a request to "Have an option to set default source in the Librato::Metrics.authenticate call".

Maybe this could look something like: Librato::Metrics.default_source = 'foo'

somewhat similar to the default source behavior in aggregator = Librato::Metrics::Aggregator.new(:source => 'foobar')

nextmat commented 9 years ago

You can already do:

queue = Librato::Metrics::Queue.new(source: 'mysource')
queue.add a_metric: 123, another_metric: 345
queue.submit

I can kind of see the value in setting something that is a default for any generated queue or aggregator, but it isn't too difficult to set it on instantiation?

jderrett commented 9 years ago

Agreed, closing this.