Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit for adding prepend in addition to alias_method #448

Merged
merged 13 commits into from
Aug 12, 2022
Prev Previous commit
Next Next commit
Add prepend kwag for all instruments
  • Loading branch information
dlanderson committed May 31, 2022
commit 1e21b74a470e7a7a05ef5c6498e945489f0d5ae5
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/action_controller_rails_2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::ActionController) && defined?(::ActionController::Base)
@installed = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def installed!
@installed = true
end

def install
def install(prepend:)
if !defined?(::ActiveSupport)
return
end
Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/action_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def prependable?
context.environment.supports_module_prepend?
end

def install
def install(prepend:)
return unless defined?(::ActionView) && defined?(::ActionView::PartialRenderer)

if prependable?
Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if install_via_after_initialize?
Rails.configuration.after_initialize do
add_instruments
Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::Elasticsearch) &&
defined?(::Elasticsearch::Transport) &&
defined?(::Elasticsearch::Transport::Client)
Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/grape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::Grape) && defined?(::Grape::Endpoint)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::HTTP) && defined?(::HTTP::Client)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::HTTPClient)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/influxdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::InfluxDB)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/memcached.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::Dalli) && defined?(::Dalli::Client)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/middleware_detailed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(ActionDispatch) && defined?(ActionDispatch::MiddlewareStack) && defined?(ActionDispatch::MiddlewareStack::Middleware)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/middleware_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(ActionDispatch) && defined?(ActionDispatch::MiddlewareStack)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/mongoid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
@installed = true

# Mongoid versions that use Moped should instrument Moped.
Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/moped.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::Moped)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/rails_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(ActionDispatch) && defined?(ActionDispatch::Routing) && defined?(ActionDispatch::Routing::RouteSet)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::Redis) && defined?(::Redis::Client)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/sinatra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::Sinatra) && defined?(::Sinatra::Base) && ::Sinatra::Base.private_method_defined?(:dispatch!)
@installed = true

Expand Down
2 changes: 1 addition & 1 deletion lib/scout_apm/instruments/typhoeus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def installed?
@installed
end

def install
def install(prepend:)
if defined?(::Typhoeus)
@installed = true

Expand Down