skylight: use Sinatra support from skylight gem
This hasn't been merged in yet, so use my fork for now.
This commit is contained in:
parent
208a8248f7
commit
928ed11c62
3
Gemfile
3
Gemfile
|
@ -20,7 +20,8 @@ gem 'bunny', '~> 0.8.0'
|
|||
gem 'dalli'
|
||||
gem 'pry'
|
||||
gem 'metriks', '0.9.9.5'
|
||||
gem 'skylight'
|
||||
|
||||
gem 'skylight', github: 'henrikhodne/skylight-ruby', branch: 'sinatra-support'
|
||||
|
||||
group :test do
|
||||
gem 'rspec', '~> 2.13'
|
||||
|
|
12
Gemfile.lock
12
Gemfile.lock
|
@ -7,6 +7,14 @@ GIT
|
|||
hashie (>= 1.1.0)
|
||||
uuidtools
|
||||
|
||||
GIT
|
||||
remote: git://github.com/henrikhodne/skylight-ruby.git
|
||||
revision: 44904fe824e202deb6389fb9b547bd4345abdc2d
|
||||
branch: sinatra-support
|
||||
specs:
|
||||
skylight (0.3.10)
|
||||
activesupport (>= 3.0.0)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/rack/rack-contrib.git
|
||||
revision: 951760b1710634623ebbccef8d65df9139bb41c2
|
||||
|
@ -249,8 +257,6 @@ GEM
|
|||
rack-test
|
||||
sinatra (~> 1.4.0)
|
||||
tilt (~> 1.3)
|
||||
skylight (0.3.10)
|
||||
activesupport (>= 3.0.0)
|
||||
slop (3.4.7)
|
||||
sprockets (2.2.2)
|
||||
hike (~> 1.2)
|
||||
|
@ -299,7 +305,7 @@ DEPENDENCIES
|
|||
sentry-raven!
|
||||
sinatra
|
||||
sinatra-contrib
|
||||
skylight
|
||||
skylight!
|
||||
travis-api!
|
||||
travis-core!
|
||||
travis-sidekiqs!
|
||||
|
|
|
@ -8,7 +8,8 @@ class Travis::Api::App
|
|||
register Extensions::SmartConstants
|
||||
|
||||
if ENV['SKYLIGHT_APPLICATION']
|
||||
register :skylight
|
||||
require 'skylight'
|
||||
register Skylight::Sinatra
|
||||
end
|
||||
|
||||
error NotImplementedError do
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
require 'logger'
|
||||
require 'skylight'
|
||||
require 'travis/api/app'
|
||||
|
||||
class Travis::Api::App
|
||||
module Extensions
|
||||
module Skylight
|
||||
def self.registered(base)
|
||||
config = ::Skylight::Config.load(nil, ENV['RACK_ENV'], ENV)
|
||||
config['root'] = base.root
|
||||
config['agent.sockfile_path'] = File.join(config['root'], 'tmp')
|
||||
config.logger = Logger.new(STDOUT)
|
||||
config.validate!
|
||||
|
||||
::Skylight.start!(config)
|
||||
|
||||
base.use ::Skylight::Middleware
|
||||
end
|
||||
|
||||
def route(verb, path, *)
|
||||
condition do
|
||||
trace = ::Skylight::Instrumenter.instance.current_trace
|
||||
endpoint = settings.name.to_s.split("::", 5).last.gsub(/::/, "/").downcase
|
||||
trace.endpoint = "#{verb} /#{endpoint}#{path}"
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user