Librato tracking for Grape, based on code from this NewRelic gem, using librato-rack
Add this line to your application's Gemfile:
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.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4