lib/heroku_metal.rb in oboe-heroku-0.9.9.0 vs lib/heroku_metal.rb in oboe-heroku-0.9.10.0
- old
+ new
@@ -17,11 +17,11 @@
evt.addInfo(k.to_s, v.to_s)
end
evt.addInfo("Backtrace", Oboe::API.backtrace) if with_backtrace
- Oboe.reporter.sendReport(evt)
+ Oboe.reporter.sendReport(evt) if Oboe.loaded
end
def tracing_layer_op?(operation)
if operation.is_a?(Array)
return operation.include?(@layer_op)
@@ -42,26 +42,32 @@
##
# Initialize the Oboe Context, reporter and report the initialization
#
def self.start
begin
+ return unless Oboe.loaded
+
+ if Oboe.reporter
+ Oboe.logger.warn "[oboe/warn] Attempt to start an already started reporter..."
+ return
+ end
+
Oboe_metal::Context.init()
Oboe.logger.debug "[oboe/debug] Initializing Heroku based reporter."
# The Oboe Reporter is configured via Heroku config variables.
Oboe.reporter = Oboe::Reporter.new(nil, nil)
-
- Oboe::API.report_init
+ Oboe::API.report_init
rescue Exception => e
$stderr.puts e.message
raise
end
end
def self.sendReport(evt)
- Oboe.reporter.sendReport(evt)
+ Oboe.reporter.sendReport(evt) if Oboe.loaded
end
end
end
module Oboe