Module: ElasticAPM::Sinatra
Overview
Module for starting the ElasticAPM agent and hooking into Sinatra.
Instance Method Summary collapse
-
#start(app, config = {}) ⇒ true?
Start the ElasticAPM agent and hook into Sinatra.
Instance Method Details
#start(app, config = {}) ⇒ true?
Start the ElasticAPM agent and hook into Sinatra.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/elastic_apm/sinatra.rb', line 29 def start(app, config = {}) config = Config.new(config) unless config.is_a?(Config) configure_app(app, config) ElasticAPM.start(config) ElasticAPM.running? rescue StandardError => e config.logger.error format('Failed to start: %s', e.) config.logger.debug "Backtrace:\n" + e.backtrace.join("\n") end |