Skip to content

Commit

Permalink
Update newrelic-grape check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle committed Oct 10, 2024
1 parent c96ac53 commit 9fc8828
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/new_relic/agent/instrumentation/grape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@

depends_on do
begin
if defined?(Bundler) &&
((Bundler.rubygems.respond_to?(:installed_specs) && Bundler.rubygems.installed_specs.map(&:name).include?('newrelic-grape')) ||
Bundler.rubygems.all_specs.map(&:name).include?('newrelic-grape'))
specs = if Bundler.rubygems.respond_to?(:installed_specs)
Bundler.rubygems.installed_specs
else
Bundler.rubygems.all_specs
end

if specs.map(&:name).include?('newrelic-grape')
NewRelic::Agent.logger.info('Not installing New Relic supported Grape instrumentation because the third party newrelic-grape gem is present')
false
else
Expand Down

0 comments on commit 9fc8828

Please sign in to comment.