File tree Expand file tree Collapse file tree 6 files changed +36
-1
lines changed Expand file tree Collapse file tree 6 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ gem 'bunny', '~> 0.8.0'
20
20
gem 'dalli'
21
21
gem 'pry'
22
22
gem 'metriks' , '0.9.9.5'
23
+ gem 'skylight'
23
24
24
25
group :test do
25
26
gem 'rspec' , '~> 2.13'
Original file line number Diff line number Diff line change 251
251
rack-test
252
252
sinatra (~> 1.4.0 )
253
253
tilt (~> 1.3 )
254
+ skylight (0.3.10 )
255
+ activesupport (>= 3.0.0 )
254
256
slop (3.4.7 )
255
257
sprockets (2.2.2 )
256
258
hike (~> 1.2 )
@@ -299,6 +301,7 @@ DEPENDENCIES
299
301
sentry-raven !
300
302
sinatra
301
303
sinatra-contrib
304
+ skylight
302
305
travis-api !
303
306
travis-core !
304
307
travis-sidekiqs !
Original file line number Diff line number Diff line change @@ -30,5 +30,18 @@ class RackTimer
30
30
end
31
31
end
32
32
33
+ if ENV [ 'SKYLIGHT_APPLICATION' ]
34
+ require 'skylight'
35
+ require 'logger'
36
+ config = Skylight ::Config . load ( nil , ENV [ 'RACK_ENV' ] , ENV )
37
+ config [ 'root' ] = File . expand_path ( '..' , __FILE__ )
38
+ config [ 'agent.sockfile_path' ] = File . expand_path ( '../tmp' , __FILE__ )
39
+ config . logger = Logger . new ( STDOUT )
40
+ config . validate!
41
+ Skylight . start! ( config )
42
+
43
+ use Skylight ::Middleware
44
+ end
45
+
33
46
use RackTimer
34
47
run Travis ::Api ::App . new
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def call(env)
44
44
disable :protection , :logging , :setup
45
45
enable :raise_errors
46
46
# disable :dump_errors
47
- register :subclass_tracker , :expose_pattern
47
+ register :subclass_tracker , :expose_pattern , :skylight
48
48
helpers :respond_with , :mime_types
49
49
end
50
50
Original file line number Diff line number Diff line change
1
+ require 'travis/api/app'
2
+ require 'skylight'
3
+
4
+ class Travis ::Api ::App
5
+ module Extensions
6
+ module Skylight
7
+ def route ( verb , path , *)
8
+ condition do
9
+ trace = ::Skylight ::Instrumenter . instance . current_trace
10
+ endpoint = settings . name . to_s . split ( "::" , 5 ) . last . gsub ( /::/ , "/" ) . downcase
11
+ trace . endpoint = "#{ verb } /#{ endpoint } #{ path } "
12
+ end
13
+
14
+ super
15
+ end
16
+ end
17
+ end
18
+ end
You can’t perform that action at this time.
0 commit comments