skylight: only load extension if skylight is available
This commit is contained in:
parent
738cbb54d3
commit
749ee8b943
|
@ -1,15 +1,16 @@
|
||||||
require 'travis/api/app'
|
require 'travis/api/app'
|
||||||
require 'skylight'
|
|
||||||
|
|
||||||
class Travis::Api::App
|
class Travis::Api::App
|
||||||
module Extensions
|
module Extensions
|
||||||
module Skylight
|
module Skylight
|
||||||
def route(verb, path, *)
|
def route(verb, path, *)
|
||||||
condition do
|
condition do
|
||||||
|
if ENV['SKYLIGHT_APPLICATION']
|
||||||
trace = ::Skylight::Instrumenter.instance.current_trace
|
trace = ::Skylight::Instrumenter.instance.current_trace
|
||||||
endpoint = settings.name.to_s.split("::", 5).last.gsub(/::/, "/").downcase
|
endpoint = settings.name.to_s.split("::", 5).last.gsub(/::/, "/").downcase
|
||||||
trace.endpoint = "#{verb} /#{endpoint}#{path}"
|
trace.endpoint = "#{verb} /#{endpoint}#{path}"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user