lib/heroku_metal.rb in oboe-heroku-0.8.0.16 vs lib/heroku_metal.rb in oboe-heroku-0.8.0.19
- old
+ new
@@ -36,10 +36,28 @@
end
end
end
class Reporter
+ ##
+ # Initialize the Oboe Context, reporter and report the initialization
+ #
+ def self.start
+ begin
+ Oboe_metal::Context.init()
+
+ # The Oboe Reporter is configured via Heroku config variables.
+ Oboe.reporter = Oboe::Reporter.new(nil, nil)
+
+ Oboe::API.report_init('ruby') unless ["development", "test"].include? ENV['RACK_ENV']
+
+ rescue Exception => e
+ $stderr.puts e.message
+ raise
+ end
+ end
+
def self.sendReport(evt)
Oboe.reporter.sendReport(evt)
end
end
end
@@ -87,17 +105,7 @@
def reconnect!
::Oboe::Context.reconnect(::Oboe.reporter)
end
end
-end
-
-begin
- Oboe_metal::Context.init()
-
- # The Oboe Reporter is configured via Heroku config variables.
- Oboe.reporter = Oboe::Reporter.new(nil, nil)
-rescue Exception => e
- $stderr.puts e.message
- raise
end