lib/elastic_apm/agent.rb in elastic-apm-2.6.1 vs lib/elastic_apm/agent.rb in elastic-apm-2.7.0
- old
+ new
@@ -31,11 +31,11 @@
LOCK.synchronize do
return @instance if @instance
unless config.active?
config.logger.debug format(
- '%sAgent disabled with active: false',
+ "%sAgent disabled with `active: false'",
Logging::PREFIX
)
return
end
@@ -73,29 +73,34 @@
end
attr_reader :config, :transport, :instrumenter,
:stacktrace_builder, :context_builder, :error_builder, :metrics
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def start
- info '[%s] Starting agent, reporting to %s', VERSION, config.server_url
+ unless config.disable_start_message
+ info '[%s] Starting agent, reporting to %s', VERSION, config.server_url
+ end
transport.start
instrumenter.start
metrics.start
config.enabled_spies.each do |lib|
+ debug "Requiring spy: #{lib}"
require "elastic_apm/spies/#{lib}"
end
self
end
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
def stop
debug 'Stopping agent'
+ metrics.stop
instrumenter.stop
transport.stop
- metrics.stop
self
end
at_exit do