lib/contrast/framework/manager.rb in contrast-agent-6.2.0 vs lib/contrast/framework/manager.rb in contrast-agent-6.3.0

- old
+ new

@@ -5,11 +5,10 @@ require 'contrast/agent/reporting/reporting_events/application_inventory' require 'contrast/components/logger' require 'contrast/extension/module' require 'contrast/framework/grape/support' require 'contrast/framework/manager_extend' -require 'contrast/framework/platform_version' require 'contrast/framework/rack/support' require 'contrast/framework/rails/support' require 'contrast/framework/sinatra/support' require 'contrast/utils/class_util' @@ -62,20 +61,10 @@ # @return [Array<Contrast::Agent::Reporting::DiscoveredRoute>] def find_route_discovery_data routes_for_all_frameworks end - def platform_version - framework_version = first_framework_result(:version, '') - - Contrast::Framework::PlatformVersion.from_string(framework_version) - end - - def platform_version_string - first_framework_result(:version, '') - end - def server_type first_framework_result(:server_type, 'rack') end def app_name @@ -155,19 +144,16 @@ SUPPORTED_FRAMEWORKS.each do |framework| next if @_frameworks.include?(framework) next unless module_name == framework.detection_class @_frameworks << framework - # Report the registered routes of that framework now that we know we need to find them - # TODO: RUBY-1438 -- remove and build ReportingEvent directly - app_update_msg = Contrast::Api::Dtm::ApplicationUpdate.build - if Contrast::Agent.reporter - report = Contrast::Agent::Reporting::DtmMessage.dtm_to_event(app_update_msg) - Contrast::Agent.reporter.send_event(report) - else - Contrast::Agent.messaging_queue.send_event_eventually(app_update_msg) + report = Contrast::Agent::Reporting::ApplicationUpdate.new + # This convert here is left as it'll be easier to be replaced when the Library is being changed + report.libraries = Contrast::Agent::Inventory::DependencyAnalysis.instance.library_pb_list + [report, Contrast::Agent::Reporting::ApplicationInventory.new].each do |e| + Contrast::Agent.reporter.send_event(e) end - Contrast::Agent.reporter.send_event(Contrast::Agent::Reporting::ApplicationInventory.new) + logger.info('Framework detected after initialization. Enabling support.', framework: framework.detection_class, frameworks: @_frameworks) break end