Method: ElasticAPM::Agent#initialize
- Defined in:
- lib/elastic_apm/agent.rb
#initialize(config) ⇒ Agent
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Agent.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/elastic_apm/agent.rb', line 79 def initialize(config) @stacktrace_builder = StacktraceBuilder.new(config) @context_builder = ContextBuilder.new(config) @error_builder = ErrorBuilder.new(self) @central_config = CentralConfig.new(config) @transport = Transport::Base.new(config) @metrics = Metrics.new(config) { |event| enqueue event } @instrumenter = Instrumenter.new( config, metrics: metrics, stacktrace_builder: stacktrace_builder ) { |event| enqueue event } @pid = Process.pid end |