49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/newrelic_security/instrumentation-security/ethon/instrumentation.rb', line 49
def perform_on_enter(*_args)
event = nil
NewRelic::Security::Agent.logger.debug "OnEnter : #{self.class}.#{__method__}"
ic_args = []
easy_handles.each do |easy|
uri = NewRelic::Security::Instrumentation::InstrumentationUtils.parse_uri(easy.url)
ic_args << easy.url.to_s if uri
end
event = NewRelic::Security::Agent::Control::Collector.collect(HTTP_REQUEST, ic_args) unless ic_args.empty?
easy_handles.each do |easy|
context = NewRelic::Security::Agent::Control::HTTPContext.get_context.cache[easy.object_id] if NewRelic::Security::Agent::Control::HTTPContext.get_context
= {}
.merge!(context[:headers]) if context&.key?(:headers)
NewRelic::Security::Instrumentation::InstrumentationUtils.add_tracing_data(, event) if event
easy. =
end
event
rescue => exception
NewRelic::Security::Agent.logger.error "Exception in hook in #{self.class}.#{__method__}, #{exception.inspect}, #{exception.backtrace}"
ensure
yield
return event
end
|