lib/contrast/agent/at_exit_hook.rb in contrast-agent-6.1.0 vs lib/contrast/agent/at_exit_hook.rb in contrast-agent-6.1.1
- old
+ new
@@ -29,10 +29,21 @@
process_pp_id: Process.ppid)
context = Contrast::Agent::REQUEST_TRACKER.current
return unless context
- Contrast::Agent.messaging_queue&.send_event_immediately(context.activity)
+ if Contrast::Agent::Reporter.enabled?
+ [
+ context.new_observed_route,
+ Contrast::Agent::Reporting::DtmMessage.dtm_to_event(context.server_activity),
+ Contrast::Agent::Reporting::DtmMessage.dtm_to_event(context.activity.library_usages),
+ Contrast::Agent::Reporting::DtmMessage.dtm_to_event(context.activity)
+ ].each do |event|
+ Contrast::Agent.reporter&.send_event_immediately(event)
+ end
+ else
+ Contrast::Agent.messaging_queue&.send_event_immediately(context.activity)
+ end
end
end
end
end