Skip to content

Commit

Permalink
Merge pull request #2789 from newrelic/grape-padrino-framework-detection
Browse files Browse the repository at this point in the history
Grape padrino framework detection
  • Loading branch information
kaylareopelle authored Aug 5, 2024
2 parents 63c1e77 + 2ba1ef3 commit 07b52cf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/new_relic/agent/configuration/default_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ def self.framework
::NewRelic::Agent.logger.warn("Detected untested Rails version #{Rails::VERSION::STRING}")
:rails_notifications
end
when defined?(::Padrino) && defined?(::Padrino::PathRouter::Router) then :padrino
when defined?(::Sinatra) && defined?(::Sinatra::Base) then :sinatra
when defined?(::Roda) then :roda
when defined?(::Grape) then :grape
when defined?(::NewRelic::IA) then :external
else :ruby
end
Expand Down
14 changes: 14 additions & 0 deletions lib/new_relic/control/frameworks/grape.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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

require 'new_relic/control/frameworks/ruby'
module NewRelic
class Control
module Frameworks
# Contains basic control logic for Grape
class Grape < NewRelic::Control::Frameworks::Ruby
end
end
end
end
14 changes: 14 additions & 0 deletions lib/new_relic/control/frameworks/padrino.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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

require 'new_relic/control/frameworks/sinatra'
module NewRelic
class Control
module Frameworks
# Contains basic control logic for Padrino
class Padrino < NewRelic::Control::Frameworks::Sinatra
end
end
end
end

0 comments on commit 07b52cf

Please sign in to comment.