Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
librato metrics for grape
Ruby
Branch: master

This branch is 11 commits ahead, 30 commits behind xinminlabs:master

Failed to load latest commit information.
lib v1.1.0
spec Increment as well as time Grape API calls
.gitignore first commit
.rspec Changed namespace from Newrelic to NewRelic to be consistent with the…
.travis.yml Add .travis.yml
CHANGELOG.md v1.1.0
Gemfile
LICENSE
README.md Update README.md
Rakefile
grape-librato.gemspec Out with NewRelic, in with Librato

README.md

Librato::Grape

Librato tracking for Grape, based on code from this NewRelic gem, using librato-rack

Build Status

Installation

Add this line to your application's Gemfile:

gem 'grape-librato'

Or install:

$ gem install grape-librato

Include it in your Grape API like this

class TestAPI < Grape::API
  use Librato::Grape::Middleware

  get 'hello' do
    "Hello World"
  end
end

Make sure you are also using the librato-rack middleware

Here's an example config.ru

require 'grape'
require 'librato-rack'
require 'grape-librato'

LIBRATO_CONFIGURATION        = Librato::Rack::Configuration.new
LIBRATO_CONFIGURATION.user   = ENV['LIBRATO_USER']
LIBRATO_CONFIGURATION.token  = ENV['LIBRATO_TOKEN']
LIBRATO_CONFIGURATION.source = ENV['LIBRATO_SOURCE'] || 'localhost'

class API < Grape::API
  use Librato::Grape::Middleware
  get 'hello' do
    "Hello World"
  end
end

use Librato::Rack, config: LIBRATO_CONFIGURATION
run API

See how to set up the Librato::Rack object in the librato-rack documentation.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Make a pull request
Something went wrong with that request. Please try again.