Sha256: d80066f7bed30eaad6f3cf5197faef7d9b793a500a09aca844d8c9dc48aee625
Contents?: true
Size: 1.22 KB
Versions: 2
Compression:
Stored size: 1.22 KB
Contents
# This file is distributed under New Relic's license terms. # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. # frozen_string_literal: true DependencyDetection.defer do @name = :sunspot depends_on do defined?(::Sunspot) end executes do ::NewRelic::Agent.logger.info('Installing Rails Sunspot instrumentation') deprecation_msg = 'The instrumentation for Sunspot is deprecated. ' \ 'It will be removed in version 9.0.0.' ::NewRelic::Agent.logger.log_once( :warn, :deprecated_sunspot, deprecation_msg ) ::NewRelic::Agent.record_metric("Supportability/Deprecated/Sunspot", 1) end executes do ::Sunspot.module_eval do class << self %w[index index!].each do |method| add_method_tracer method, 'SolrClient/Sunspot/index' end add_method_tracer :commit, 'SolrClient/Sunspot/commit' %w[search more_like_this].each do |method| add_method_tracer method, 'SolrClient/Sunspot/query' end %w[remove remove! remove_by_id remove_by_id! remove_all remove_all!].each do |method| add_method_tracer method, 'SolrClient/Sunspot/delete' end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
newrelic_rpm-8.12.0 | lib/new_relic/agent/instrumentation/sunspot.rb |
newrelic_rpm-8.11.0 | lib/new_relic/agent/instrumentation/sunspot.rb |