module NewRelic::Agent::Instrumentation::LogStasher

Constants

INSTRUMENTATION_NAME

Public Class Methods

enabled?() click to toggle source
# File lib/new_relic/agent/instrumentation/logstasher/instrumentation.rb, line 9
def self.enabled?
  NewRelic::Agent.config[:'instrumentation.logstasher'] != 'disabled'
end

Public Instance Methods

build_logstash_event_with_new_relic(*args) { || ... } click to toggle source
# File lib/new_relic/agent/instrumentation/logstasher/instrumentation.rb, line 13
def build_logstash_event_with_new_relic(*args)
  logstasher_event = yield
  log = logstasher_event.instance_variable_get(:@data)

  ::NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
  ::NewRelic::Agent.agent.log_event_aggregator.record_logstasher_event(log)
  ::NewRelic::Agent::LocalLogDecorator.decorate(log)

  logstasher_event
end