instana 1.192.1 → 1.193.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +200 -133
- data/.gitignore +3 -0
- data/.rubocop.yml +10 -1145
- data/.rubocop_todo.yml +1140 -0
- data/Appraisals +103 -0
- data/Gemfile +14 -32
- data/LICENSE +2 -1
- data/Rakefile +19 -39
- data/benchmarks/10k-rack-traces.rb +3 -0
- data/benchmarks/Gemfile +4 -0
- data/benchmarks/id_generation.rb +4 -0
- data/benchmarks/opentracing.rb +4 -0
- data/benchmarks/rack_vanilla_vs_traced.rb +3 -0
- data/benchmarks/stackprof_rack_tracing.rb +3 -0
- data/benchmarks/time_processing.rb +4 -0
- data/bin/console +8 -4
- data/examples/opentracing.rb +4 -0
- data/examples/tracing.rb +4 -0
- data/extras/license_header.rb +44 -0
- data/gemfiles/.bundle/config +1 -2
- data/gemfiles/cuba_30.gemfile +18 -0
- data/gemfiles/dalli_20.gemfile +18 -0
- data/gemfiles/excon_02.gemfile +18 -0
- data/gemfiles/graphql_10.gemfile +18 -0
- data/gemfiles/grpc_10.gemfile +18 -0
- data/gemfiles/net_http_01.gemfile +17 -0
- data/gemfiles/rack_16.gemfile +18 -0
- data/gemfiles/rack_20.gemfile +18 -0
- data/gemfiles/rails_42.gemfile +21 -0
- data/gemfiles/rails_50.gemfile +21 -0
- data/gemfiles/rails_52.gemfile +21 -0
- data/gemfiles/rails_60.gemfile +21 -0
- data/gemfiles/redis_40.gemfile +18 -0
- data/gemfiles/resque_122.gemfile +19 -0
- data/gemfiles/resque_20.gemfile +18 -0
- data/gemfiles/rest_client_16.gemfile +18 -0
- data/gemfiles/rest_client_20.gemfile +18 -0
- data/gemfiles/roda_20.gemfile +18 -0
- data/gemfiles/roda_30.gemfile +18 -0
- data/gemfiles/sidekiq_42.gemfile +18 -0
- data/gemfiles/sidekiq_50.gemfile +18 -0
- data/gemfiles/sinatra_14.gemfile +18 -0
- data/instana.gemspec +5 -7
- data/lib/instana.rb +3 -0
- data/lib/instana/activator.rb +44 -0
- data/lib/instana/activators/action_cable.rb +24 -0
- data/lib/instana/activators/action_controller_api.rb +21 -0
- data/lib/instana/activators/action_controller_base.rb +21 -0
- data/lib/instana/activators/action_view.rb +21 -0
- data/lib/instana/activators/active_record.rb +21 -0
- data/lib/instana/activators/cuba.rb +21 -0
- data/lib/instana/activators/dalli.rb +23 -0
- data/lib/instana/activators/excon.rb +20 -0
- data/lib/instana/activators/graphql.rb +22 -0
- data/lib/instana/activators/grpc_client.rb +20 -0
- data/lib/instana/activators/grpc_server.rb +20 -0
- data/lib/instana/activators/net_http.rb +20 -0
- data/lib/instana/activators/rack.rb +16 -0
- data/lib/instana/activators/rails.rb +18 -0
- data/lib/instana/activators/redis.rb +20 -0
- data/lib/instana/activators/resque_client.rb +21 -0
- data/lib/instana/activators/resque_worker.rb +33 -0
- data/lib/instana/activators/rest_client.rb +20 -0
- data/lib/instana/activators/roda.rb +21 -0
- data/lib/instana/activators/sidekiq_client.rb +24 -0
- data/lib/instana/activators/sidekiq_worker.rb +24 -0
- data/lib/instana/activators/sinatra.rb +21 -0
- data/lib/instana/agent.rb +3 -0
- data/lib/instana/agent/helpers.rb +3 -0
- data/lib/instana/agent/hooks.rb +3 -0
- data/lib/instana/agent/tasks.rb +3 -0
- data/lib/instana/base.rb +3 -0
- data/lib/instana/collector.rb +3 -0
- data/lib/instana/collectors/gc.rb +3 -0
- data/lib/instana/collectors/memory.rb +3 -0
- data/lib/instana/collectors/thread.rb +3 -0
- data/lib/instana/config.rb +3 -0
- data/lib/instana/frameworks/cuba.rb +9 -13
- data/lib/instana/frameworks/rails.rb +22 -32
- data/lib/instana/frameworks/roda.rb +10 -13
- data/lib/instana/frameworks/sinatra.rb +4 -8
- data/lib/instana/helpers.rb +3 -0
- data/lib/instana/instrumentation/action_cable.rb +53 -0
- data/lib/instana/instrumentation/action_controller.rb +84 -0
- data/lib/instana/instrumentation/action_view.rb +30 -0
- data/lib/instana/instrumentation/active_record.rb +50 -0
- data/lib/instana/instrumentation/dalli.rb +10 -18
- data/lib/instana/instrumentation/excon.rb +54 -57
- data/lib/instana/instrumentation/graphql.rb +19 -18
- data/lib/instana/instrumentation/grpc.rb +73 -66
- data/lib/instana/instrumentation/instrumented_request.rb +6 -1
- data/lib/instana/instrumentation/net-http.rb +46 -47
- data/lib/instana/instrumentation/rack.rb +4 -0
- data/lib/instana/instrumentation/redis.rb +13 -18
- data/lib/instana/instrumentation/resque.rb +17 -50
- data/lib/instana/instrumentation/rest-client.rb +5 -17
- data/lib/instana/instrumentation/sidekiq-client.rb +3 -9
- data/lib/instana/instrumentation/sidekiq-worker.rb +3 -9
- data/lib/instana/opentracing/carrier.rb +3 -0
- data/lib/instana/opentracing/tracer.rb +3 -0
- data/lib/instana/rack.rb +4 -0
- data/lib/instana/secrets.rb +10 -7
- data/lib/instana/setup.rb +6 -1
- data/lib/instana/thread_local.rb +3 -0
- data/lib/instana/tracer.rb +3 -0
- data/lib/instana/tracing/processor.rb +3 -0
- data/lib/instana/tracing/span.rb +3 -0
- data/lib/instana/tracing/span_context.rb +3 -0
- data/lib/instana/util.rb +4 -41
- data/lib/instana/version.rb +4 -1
- data/lib/oj_check.rb +3 -0
- data/lib/opentracing.rb +3 -0
- data/test/activator_test.rb +30 -0
- data/test/agent/agent_test.rb +3 -0
- data/test/benchmarks/bench_id_generation.rb +3 -0
- data/test/benchmarks/bench_opentracing.rb +3 -0
- data/test/config_test.rb +3 -0
- data/test/frameworks/cuba_test.rb +41 -40
- data/test/frameworks/roda_test.rb +43 -41
- data/test/frameworks/sinatra_test.rb +64 -64
- data/test/instana_test.rb +3 -0
- data/test/instrumentation/dalli_test.rb +3 -0
- data/test/instrumentation/excon_test.rb +4 -0
- data/test/instrumentation/graphql_test.rb +3 -0
- data/test/instrumentation/grpc_test.rb +5 -1
- data/test/instrumentation/{net-http_test.rb → net_http_test.rb} +4 -0
- data/test/instrumentation/{instrumented_request_test.rb → rack_instrumented_request_test.rb} +4 -1
- data/test/{frameworks → instrumentation}/rack_test.rb +3 -1
- data/test/instrumentation/rails_action_cable_test.rb +131 -0
- data/test/{frameworks/rails/actioncontroller_test.rb → instrumentation/rails_action_controller_test.rb} +40 -21
- data/test/instrumentation/rails_action_view_test.rb +151 -0
- data/test/instrumentation/rails_active_record_test.rb +122 -0
- data/test/instrumentation/redis_test.rb +3 -0
- data/test/instrumentation/resque_test.rb +6 -11
- data/test/instrumentation/{rest-client_test.rb → rest_client_test.rb} +9 -0
- data/test/instrumentation/sidekiq-client_test.rb +4 -0
- data/test/instrumentation/sidekiq-worker_test.rb +4 -0
- data/test/secrets_test.rb +3 -0
- data/test/support/apps/active_record/active_record.rb +24 -0
- data/test/{servers/grpc_50051.rb → support/apps/grpc/boot.rb} +4 -1
- data/test/{apps → support/apps/grpc}/grpc_server.rb +3 -0
- data/test/{servers/rackapp_6511.rb → support/apps/http_endpoint/boot.rb} +3 -0
- data/test/{servers/rails_3205.rb → support/apps/rails/boot.rb} +10 -13
- data/test/{models → support/apps/rails/models}/block.rb +4 -1
- data/test/{models → support/apps/rails/models}/block6.rb +3 -0
- data/test/support/apps/resque/boot.rb +5 -0
- data/test/{jobs → support/apps/resque/jobs}/resque_error_job.rb +3 -0
- data/test/{jobs → support/apps/resque/jobs}/resque_fast_job.rb +3 -0
- data/test/support/apps/sidekiq/boot.rb +25 -0
- data/test/{jobs → support/apps/sidekiq/jobs}/sidekiq_job_1.rb +3 -0
- data/test/{jobs → support/apps/sidekiq/jobs}/sidekiq_job_2.rb +3 -0
- data/test/{servers → support/apps}/sidekiq/worker.rb +5 -2
- data/test/support/helpers.rb +97 -0
- data/test/test_helper.rb +27 -144
- data/test/tracing/custom_test.rb +3 -0
- data/test/tracing/id_management_test.rb +4 -0
- data/test/tracing/opentracing_test.rb +3 -0
- data/test/tracing/tracer_async_test.rb +3 -0
- data/test/tracing/tracer_test.rb +3 -0
- metadata +105 -96
- data/gemfiles/libraries.gemfile +0 -73
- data/gemfiles/rails32.gemfile +0 -51
- data/gemfiles/rails42.gemfile +0 -50
- data/gemfiles/rails50.gemfile +0 -52
- data/gemfiles/rails52.gemfile +0 -52
- data/gemfiles/rails60.gemfile +0 -72
- data/lib/instana/frameworks/instrumentation/abstract_mysql_adapter.rb +0 -58
- data/lib/instana/frameworks/instrumentation/action_controller.rb +0 -194
- data/lib/instana/frameworks/instrumentation/action_view.rb +0 -43
- data/lib/instana/frameworks/instrumentation/active_record.rb +0 -27
- data/lib/instana/frameworks/instrumentation/mysql2_adapter.rb +0 -87
- data/lib/instana/frameworks/instrumentation/mysql_adapter.rb +0 -62
- data/lib/instana/frameworks/instrumentation/postgresql_adapter.rb +0 -103
- data/lib/instana/instrumentation.rb +0 -25
- data/lib/instana/test.rb +0 -43
- data/test/apps/cuba.rb +0 -19
- data/test/apps/roda.rb +0 -13
- data/test/apps/sinatra.rb +0 -9
- data/test/frameworks/rails/actionview3_test.rb +0 -210
- data/test/frameworks/rails/actionview4_test.rb +0 -208
- data/test/frameworks/rails/actionview5_test.rb +0 -221
- data/test/frameworks/rails/activerecord_test.rb +0 -279
- data/test/servers/helpers/sidekiq_worker_initializer.rb +0 -27
@@ -0,0 +1,24 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class ActionCable < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::ActionCable::Connection::Base) && defined?(::ActionCable::Channel::Base)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/action_cable'
|
13
|
+
|
14
|
+
::ActionCable::Connection::Base
|
15
|
+
.prepend(Instana::Instrumentation::ActionCableConnection)
|
16
|
+
|
17
|
+
::ActionCable::Channel::Base
|
18
|
+
.prepend(Instana::Instrumentation::ActionCableChannel)
|
19
|
+
|
20
|
+
true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class ActionControllerAPI < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::ActionController::API)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/action_controller'
|
13
|
+
|
14
|
+
::ActionController::API
|
15
|
+
.prepend(Instana::Instrumentation::ActionController)
|
16
|
+
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class ActionControllerBase < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::ActionController::Base)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/action_controller'
|
13
|
+
|
14
|
+
::ActionController::Base
|
15
|
+
.prepend(Instana::Instrumentation::ActionController)
|
16
|
+
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class ActionView < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::ActionView::PartialRenderer)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/action_view'
|
13
|
+
|
14
|
+
::ActionView::PartialRenderer
|
15
|
+
.prepend(Instana::Instrumentation::ActionView)
|
16
|
+
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class ActiveRecord < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::ActiveRecord::ConnectionAdapters::AbstractAdapter)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/active_record'
|
13
|
+
|
14
|
+
::ActiveRecord::ConnectionAdapters::AbstractAdapter
|
15
|
+
.prepend(Instana::Instrumentation::ActiveRecord)
|
16
|
+
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Cuba < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Instana::Rack) && defined?(::Cuba)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/frameworks/cuba'
|
13
|
+
|
14
|
+
::Cuba.use ::Instana::Rack
|
15
|
+
::Cuba.prepend ::Instana::CubaPathTemplateExtractor
|
16
|
+
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Dalli < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Dalli::Client) &&
|
9
|
+
defined?(::Dalli::Server) &&
|
10
|
+
Instana.config[:dalli][:enabled]
|
11
|
+
end
|
12
|
+
|
13
|
+
def instrument
|
14
|
+
require 'instana/instrumentation/dalli'
|
15
|
+
|
16
|
+
::Dalli::Client.prepend ::Instana::Instrumentation::Dalli
|
17
|
+
::Dalli::Server.prepend ::Instana::Instrumentation::DalliServer
|
18
|
+
|
19
|
+
true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Excon < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Excon) && Instana.config[:excon][:enabled]
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/excon'
|
13
|
+
|
14
|
+
::Excon.defaults[:middlewares].unshift(::Instana::Instrumentation::Excon)
|
15
|
+
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Graphql < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::GraphQL::Schema) &&
|
9
|
+
defined?(GraphQL::Tracing::PlatformTracing) &&
|
10
|
+
Instana.config[:graphql][:enabled]
|
11
|
+
end
|
12
|
+
|
13
|
+
def instrument
|
14
|
+
require 'instana/instrumentation/graphql'
|
15
|
+
|
16
|
+
::GraphQL::Schema.use(::Instana::Instrumentation::GraphqlTracing)
|
17
|
+
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class GrpcClient < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::GRPC::ActiveCall) && ::Instana.config[:grpc][:enabled]
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/grpc'
|
13
|
+
|
14
|
+
::GRPC::ClientStub.prepend(::Instana::Instrumentation::GRPCCientInstrumentation)
|
15
|
+
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class GrpcServer < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::GRPC::RpcDesc) && ::Instana.config[:grpc][:enabled]
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/grpc'
|
13
|
+
|
14
|
+
::GRPC::RpcDesc.prepend(::Instana::Instrumentation::GRPCServerInstrumentation)
|
15
|
+
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class NetHTTP < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Net::HTTP) && ::Instana.config[:nethttp][:enabled]
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/net-http'
|
13
|
+
|
14
|
+
::Net::HTTP.prepend(::Instana::Instrumentation::NetHTTPInstrumentation)
|
15
|
+
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Rack < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Rack)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/rack'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Rails < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Instana::Rack) &&
|
9
|
+
defined?(::Rails) &&
|
10
|
+
defined?(::Rails::VERSION)
|
11
|
+
end
|
12
|
+
|
13
|
+
def instrument
|
14
|
+
require 'instana/frameworks/rails'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Redis < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Redis) && ::Instana.config[:redis][:enabled]
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/redis'
|
13
|
+
|
14
|
+
::Redis::Client.prepend(::Instana::RedisInstrumentation)
|
15
|
+
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class ResqueClient < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Resque) &&
|
9
|
+
::Instana.config[:'resque-client'][:enabled]
|
10
|
+
end
|
11
|
+
|
12
|
+
def instrument
|
13
|
+
require 'instana/instrumentation/resque'
|
14
|
+
|
15
|
+
::Resque.prepend(::Instana::Instrumentation::ResqueClient)
|
16
|
+
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class ResqueWorker < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Resque::Worker) &&
|
9
|
+
defined?(::Resque::Job) &&
|
10
|
+
::Instana.config[:'resque-worker'][:enabled]
|
11
|
+
end
|
12
|
+
|
13
|
+
def instrument
|
14
|
+
require 'instana/instrumentation/resque'
|
15
|
+
|
16
|
+
::Resque::Worker.prepend(::Instana::Instrumentation::ResqueWorker)
|
17
|
+
::Resque::Job.prepend(::Instana::Instrumentation::ResqueJob)
|
18
|
+
|
19
|
+
::Resque.before_fork do |_job|
|
20
|
+
::Instana.agent.before_resque_fork
|
21
|
+
end
|
22
|
+
::Resque.after_fork do |_job|
|
23
|
+
::Instana.agent.after_resque_fork
|
24
|
+
end
|
25
|
+
|
26
|
+
# Set this so we assure that any remaining collected traces are reported at_exit
|
27
|
+
ENV['RUN_AT_EXIT_HOOKS'] = "1"
|
28
|
+
|
29
|
+
true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class RestClient < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::RestClient::Request) && ::Instana.config[:'rest-client'][:enabled]
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/rest-client'
|
13
|
+
|
14
|
+
::RestClient::Request.prepend ::Instana::Instrumentation::RestClientRequest
|
15
|
+
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class Roda < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Instana::Rack) && defined?(::Roda)
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/frameworks/roda'
|
13
|
+
|
14
|
+
::Roda.use ::Instana::Rack
|
15
|
+
::Roda.plugin ::Instana::RodaPathTemplateExtractor
|
16
|
+
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2021
|
2
|
+
# (c) Copyright Instana Inc. 2021
|
3
|
+
|
4
|
+
module Instana
|
5
|
+
module Activators
|
6
|
+
class SidekiqClient < Activator
|
7
|
+
def can_instrument?
|
8
|
+
defined?(::Sidekiq) && ::Instana.config[:'sidekiq-client'][:enabled]
|
9
|
+
end
|
10
|
+
|
11
|
+
def instrument
|
12
|
+
require 'instana/instrumentation/sidekiq-client'
|
13
|
+
|
14
|
+
::Sidekiq.configure_client do |cfg|
|
15
|
+
cfg.client_middleware do |chain|
|
16
|
+
chain.add ::Instana::Instrumentation::SidekiqClient
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|