Ruby users, librato-metrics 0.5.0 is released — Librato Blog

Ruby users, librato-metrics 0.5.0 is released

Our ruby gem,, has reached version 0.5.0! This version is packed with goodness to make using Metrics even easier. Let's get into the details:

Improved Network Handling

We've improved network management in several ways. First, we now use faraday under the hood, which allows you to use the network library of your choice to communicate with Metrics. The default is Net::HTTP, but adapters exist for typhoeusexconem-synchrony and more. If you use an alternative ruby interpreter this will also give you more freedom to use what works best for you.

Another improvement is automatic retry handling. While previous versions would choke on intermittent errors and timeouts that might be returned by proxies or other intermediaries, 0.5.0 and above will auto-retry several times, helping to ensure that your valuable data makes it to Metrics.

Finally, when submitting metrics with librato-metrics we'll automatically size your measurements into requests for maximal performance. Need to submit 10,000 measurements at once? No problem. Queue them up they'll automatically be split into multiple requests and batch-processed!

Multiple Credential Support

Before now, you were always limited to using a single set of credentials with librato-metrics. No more, now you can create multiple instances of Client and authenticate them to different accounts:

joe =
joe.authenticate 'email1', 'api_key1'

mike =
mike.authenticate 'email2', 'api_key2'
Client instances take all the same methods that Librato::Metrics does, so using multiple accounts couldn't be easier:
# list Joe's metrics

# fetch the last 20 data points for Mike's metric, humidity
mike.fetch :humidity, :count => 20

See the project README for more details on how to use Client.

Improved Error Handling

Along with smarter automatic error handling in the network layer, we've also cleaned up librato-metric's exceptions. While network operations would frequently raise exceptions from our network library before, now all network errors descend from Librato::Metrics::NetworkError. Common errors have their own child exceptions as well. This makes error handling for quick scripts much simpler and consistent. If you have been using a version of librato-metrics before 0.5, be aware that you may need to tweak your exception handling when you upgrade.

librato-metrics 0.5.0 is available now and includes many other improvements. This is a recommended upgrade if you're using any previous version of librato-metrics.