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