lib/contrast/agent/at_exit_hook.rb in contrast-agent-6.2.0 vs lib/contrast/agent/at_exit_hook.rb in contrast-agent-6.3.0
- old
+ new
@@ -29,19 +29,19 @@
process_pp_id: Process.ppid)
context = Contrast::Agent::REQUEST_TRACKER.current
return unless context
- Contrast::Agent.reporter.send_event_immediately(context.observed_library_usage)
+ [
+ Contrast::Agent::Inventory::DependencyUsageAnalysis.instance.generate_library_usage,
+ context.observed_route
+ ].compact.each do |event|
+ Contrast::Agent.reporter&.send_event_immediately(event)
+ end
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)
- ].each do |event|
- Contrast::Agent.reporter&.send_event_immediately(event)
- end
+ event = Contrast::Agent::Reporting::DtmMessage.dtm_to_event(context.activity)
+ Contrast::Agent.reporter&.send_event_immediately(event)
else
Contrast::Agent.messaging_queue&.send_event_immediately(context.activity)
end
end
end