appsignal 2.11.7 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/.rubocop_todo.yml +1 -1
- data/.semaphore/semaphore.yml +88 -111
- data/CHANGELOG.md +23 -0
- data/appsignal.gemspec +1 -1
- data/build_matrix.yml +11 -15
- data/lib/appsignal.rb +2 -29
- data/lib/appsignal/auth_check.rb +2 -8
- data/lib/appsignal/cli.rb +1 -23
- data/lib/appsignal/config.rb +0 -24
- data/lib/appsignal/event_formatter.rb +0 -25
- data/lib/appsignal/helpers/instrumentation.rb +69 -5
- data/lib/appsignal/hooks.rb +6 -13
- data/lib/appsignal/hooks/action_cable.rb +3 -34
- data/lib/appsignal/hooks/active_support_notifications.rb +7 -86
- data/lib/appsignal/hooks/celluloid.rb +5 -9
- data/lib/appsignal/hooks/net_http.rb +2 -12
- data/lib/appsignal/hooks/puma.rb +3 -5
- data/lib/appsignal/hooks/que.rb +1 -1
- data/lib/appsignal/hooks/rake.rb +2 -24
- data/lib/appsignal/hooks/redis.rb +2 -13
- data/lib/appsignal/hooks/resque.rb +2 -43
- data/lib/appsignal/hooks/sidekiq.rb +6 -143
- data/lib/appsignal/hooks/unicorn.rb +3 -24
- data/lib/appsignal/hooks/webmachine.rb +1 -7
- data/lib/appsignal/integrations/action_cable.rb +34 -0
- data/lib/appsignal/integrations/active_support_notifications.rb +77 -0
- data/lib/appsignal/integrations/net_http.rb +16 -0
- data/lib/appsignal/integrations/object.rb +39 -4
- data/lib/appsignal/integrations/padrino.rb +5 -7
- data/lib/appsignal/integrations/que.rb +26 -33
- data/lib/appsignal/integrations/railtie.rb +1 -4
- data/lib/appsignal/integrations/rake.rb +26 -2
- data/lib/appsignal/integrations/redis.rb +17 -0
- data/lib/appsignal/integrations/resque.rb +39 -10
- data/lib/appsignal/integrations/sidekiq.rb +171 -0
- data/lib/appsignal/integrations/unicorn.rb +28 -0
- data/lib/appsignal/integrations/webmachine.rb +22 -24
- data/lib/appsignal/minutely.rb +6 -12
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/auth_check_spec.rb +1 -24
- data/spec/lib/appsignal/cli_spec.rb +1 -1
- data/spec/lib/appsignal/config_spec.rb +0 -66
- data/spec/lib/appsignal/event_formatter_spec.rb +0 -37
- data/spec/lib/appsignal/hooks/celluloid_spec.rb +6 -1
- data/spec/lib/appsignal/hooks/rake_spec.rb +1 -2
- data/spec/lib/appsignal/hooks/redis_spec.rb +50 -15
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +12 -464
- data/spec/lib/appsignal/hooks/unicorn_spec.rb +14 -3
- data/spec/lib/appsignal/hooks/webmachine_spec.rb +2 -13
- data/spec/lib/appsignal/hooks_spec.rb +6 -22
- data/spec/lib/appsignal/integrations/object_spec.rb +91 -8
- data/spec/lib/appsignal/integrations/padrino_spec.rb +2 -3
- data/spec/lib/appsignal/integrations/railtie_spec.rb +0 -45
- data/spec/lib/appsignal/integrations/sidekiq_spec.rb +524 -0
- data/spec/lib/appsignal/integrations/webmachine_spec.rb +26 -8
- data/spec/lib/appsignal/minutely_spec.rb +0 -19
- data/spec/lib/appsignal/transaction_spec.rb +1 -14
- data/spec/lib/appsignal/transmitter_spec.rb +1 -1
- data/spec/lib/appsignal_spec.rb +162 -116
- data/spec/lib/puma/appsignal_spec.rb +28 -0
- data/spec/spec_helper.rb +1 -15
- metadata +11 -21
- data/lib/appsignal/cli/notify_of_deploy.rb +0 -131
- data/lib/appsignal/integrations/object_ruby_19.rb +0 -37
- data/lib/appsignal/integrations/object_ruby_modern.rb +0 -64
- data/lib/appsignal/integrations/resque_active_job.rb +0 -19
- data/lib/appsignal/js_exception_transaction.rb +0 -56
- data/lib/appsignal/rack/js_exception_catcher.rb +0 -80
- data/spec/lib/appsignal/cli/notify_of_deploy_spec.rb +0 -180
- data/spec/lib/appsignal/integrations/object_19_spec.rb +0 -266
- data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +0 -28
- data/spec/lib/appsignal/integrations/resque_spec.rb +0 -28
- data/spec/lib/appsignal/js_exception_transaction_spec.rb +0 -128
- data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +0 -170
@@ -23,6 +23,27 @@ RSpec.describe "Puma plugin" do
|
|
23
23
|
def self.stats
|
24
24
|
end
|
25
25
|
|
26
|
+
def self.run
|
27
|
+
# Capture threads running before application is preloaded
|
28
|
+
before = Thread.list.reject { |t| t.thread_variable_get(:fork_safe) }
|
29
|
+
|
30
|
+
# An abbreviated version of what happens in Puma::Cluster#run
|
31
|
+
launcher = MockPumaLauncher.new
|
32
|
+
plugin = Plugin.plugin.new
|
33
|
+
plugin.start(launcher)
|
34
|
+
launcher.events.on_booted.call
|
35
|
+
|
36
|
+
# Wait for minutely probe thread to finish starting
|
37
|
+
sleep 0.005
|
38
|
+
|
39
|
+
# Capture any new threads running after application is preloaded.
|
40
|
+
# Any threads created during the preloading phase will not be
|
41
|
+
# carried over into the forked workers. Puma warns about these
|
42
|
+
# but the minutely probe thread should only exist in the main process.
|
43
|
+
after = Thread.list.reject { |t| t.thread_variable_get(:fork_safe) }
|
44
|
+
$stdout.puts "! WARNING: Detected #{after.size - before.size} Thread(s) started in app boot" if after.size > before.size
|
45
|
+
end
|
46
|
+
|
26
47
|
class Plugin
|
27
48
|
class << self
|
28
49
|
attr_reader :plugin
|
@@ -68,6 +89,13 @@ RSpec.describe "Puma plugin" do
|
|
68
89
|
wait_for("enough probe calls") { probe.calls >= 2 }
|
69
90
|
end
|
70
91
|
|
92
|
+
it "marks the PumaProbe thread as fork-safe", :not_ruby19 do
|
93
|
+
out_stream = std_stream
|
94
|
+
capture_stdout(out_stream) { Puma.run }
|
95
|
+
|
96
|
+
expect(out_stream.read).not_to include("WARNING: Detected 1 Thread")
|
97
|
+
end
|
98
|
+
|
71
99
|
context "without Puma.stats" do
|
72
100
|
before { Puma.singleton_class.send(:remove_method, :stats) }
|
73
101
|
|
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,7 @@ ENV["RAILS_ENV"] ||= "test"
|
|
2
2
|
ENV["RACK_ENV"] ||= "test"
|
3
3
|
ENV["PADRINO_ENV"] ||= "test"
|
4
4
|
|
5
|
-
APPSIGNAL_SPEC_DIR = File.expand_path(
|
5
|
+
APPSIGNAL_SPEC_DIR = File.expand_path(__dir__)
|
6
6
|
$LOAD_PATH.unshift(File.join(APPSIGNAL_SPEC_DIR, "support/stubs"))
|
7
7
|
|
8
8
|
Bundler.require :default
|
@@ -85,20 +85,6 @@ RSpec.configure do |config|
|
|
85
85
|
FileUtils.mkdir_p(spec_system_tmp_dir)
|
86
86
|
end
|
87
87
|
|
88
|
-
config.before :each, :only_ruby19 => true do
|
89
|
-
is_ruby19 = Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.0.0")
|
90
|
-
next if is_ruby19
|
91
|
-
|
92
|
-
skip "Skipping spec. Only for Ruby 1.9"
|
93
|
-
end
|
94
|
-
|
95
|
-
config.before :each, :not_ruby19 => true do
|
96
|
-
is_ruby19 = Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.0.0")
|
97
|
-
next unless is_ruby19
|
98
|
-
|
99
|
-
skip "Skipping spec for Ruby 1.9"
|
100
|
-
end
|
101
|
-
|
102
88
|
config.before do
|
103
89
|
stop_minutely_probes
|
104
90
|
ENV["RAILS_ENV"] ||= "test"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -188,7 +188,6 @@ files:
|
|
188
188
|
- lib/appsignal/cli/diagnose/utils.rb
|
189
189
|
- lib/appsignal/cli/helpers.rb
|
190
190
|
- lib/appsignal/cli/install.rb
|
191
|
-
- lib/appsignal/cli/notify_of_deploy.rb
|
192
191
|
- lib/appsignal/config.rb
|
193
192
|
- lib/appsignal/demo.rb
|
194
193
|
- lib/appsignal/environment.rb
|
@@ -226,24 +225,26 @@ files:
|
|
226
225
|
- lib/appsignal/hooks/sidekiq.rb
|
227
226
|
- lib/appsignal/hooks/unicorn.rb
|
228
227
|
- lib/appsignal/hooks/webmachine.rb
|
228
|
+
- lib/appsignal/integrations/action_cable.rb
|
229
|
+
- lib/appsignal/integrations/active_support_notifications.rb
|
229
230
|
- lib/appsignal/integrations/capistrano/appsignal.cap
|
230
231
|
- lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
|
231
232
|
- lib/appsignal/integrations/data_mapper.rb
|
232
233
|
- lib/appsignal/integrations/delayed_job_plugin.rb
|
233
234
|
- lib/appsignal/integrations/grape.rb
|
234
235
|
- lib/appsignal/integrations/mongo_ruby_driver.rb
|
236
|
+
- lib/appsignal/integrations/net_http.rb
|
235
237
|
- lib/appsignal/integrations/object.rb
|
236
|
-
- lib/appsignal/integrations/object_ruby_19.rb
|
237
|
-
- lib/appsignal/integrations/object_ruby_modern.rb
|
238
238
|
- lib/appsignal/integrations/padrino.rb
|
239
239
|
- lib/appsignal/integrations/que.rb
|
240
240
|
- lib/appsignal/integrations/railtie.rb
|
241
241
|
- lib/appsignal/integrations/rake.rb
|
242
|
+
- lib/appsignal/integrations/redis.rb
|
242
243
|
- lib/appsignal/integrations/resque.rb
|
243
|
-
- lib/appsignal/integrations/
|
244
|
+
- lib/appsignal/integrations/sidekiq.rb
|
244
245
|
- lib/appsignal/integrations/sinatra.rb
|
246
|
+
- lib/appsignal/integrations/unicorn.rb
|
245
247
|
- lib/appsignal/integrations/webmachine.rb
|
246
|
-
- lib/appsignal/js_exception_transaction.rb
|
247
248
|
- lib/appsignal/logger.rb
|
248
249
|
- lib/appsignal/marker.rb
|
249
250
|
- lib/appsignal/minutely.rb
|
@@ -251,7 +252,6 @@ files:
|
|
251
252
|
- lib/appsignal/probes/puma.rb
|
252
253
|
- lib/appsignal/probes/sidekiq.rb
|
253
254
|
- lib/appsignal/rack/generic_instrumentation.rb
|
254
|
-
- lib/appsignal/rack/js_exception_catcher.rb
|
255
255
|
- lib/appsignal/rack/rails_instrumentation.rb
|
256
256
|
- lib/appsignal/rack/sinatra_instrumentation.rb
|
257
257
|
- lib/appsignal/rack/streaming_listener.rb
|
@@ -280,7 +280,6 @@ files:
|
|
280
280
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
281
281
|
- spec/lib/appsignal/cli/helpers_spec.rb
|
282
282
|
- spec/lib/appsignal/cli/install_spec.rb
|
283
|
-
- spec/lib/appsignal/cli/notify_of_deploy_spec.rb
|
284
283
|
- spec/lib/appsignal/cli_spec.rb
|
285
284
|
- spec/lib/appsignal/config_spec.rb
|
286
285
|
- spec/lib/appsignal/demo_spec.rb
|
@@ -324,23 +323,19 @@ files:
|
|
324
323
|
- spec/lib/appsignal/integrations/data_mapper_spec.rb
|
325
324
|
- spec/lib/appsignal/integrations/grape_spec.rb
|
326
325
|
- spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
|
327
|
-
- spec/lib/appsignal/integrations/object_19_spec.rb
|
328
326
|
- spec/lib/appsignal/integrations/object_spec.rb
|
329
327
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
330
328
|
- spec/lib/appsignal/integrations/que_spec.rb
|
331
329
|
- spec/lib/appsignal/integrations/railtie_spec.rb
|
332
|
-
- spec/lib/appsignal/integrations/
|
333
|
-
- spec/lib/appsignal/integrations/resque_spec.rb
|
330
|
+
- spec/lib/appsignal/integrations/sidekiq_spec.rb
|
334
331
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
335
332
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
336
|
-
- spec/lib/appsignal/js_exception_transaction_spec.rb
|
337
333
|
- spec/lib/appsignal/logger_spec.rb
|
338
334
|
- spec/lib/appsignal/marker_spec.rb
|
339
335
|
- spec/lib/appsignal/minutely_spec.rb
|
340
336
|
- spec/lib/appsignal/probes/puma_spec.rb
|
341
337
|
- spec/lib/appsignal/probes/sidekiq_spec.rb
|
342
338
|
- spec/lib/appsignal/rack/generic_instrumentation_spec.rb
|
343
|
-
- spec/lib/appsignal/rack/js_exception_catcher_spec.rb
|
344
339
|
- spec/lib/appsignal/rack/rails_instrumentation_spec.rb
|
345
340
|
- spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
|
346
341
|
- spec/lib/appsignal/rack/streaming_listener_spec.rb
|
@@ -411,7 +406,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
411
406
|
requirements:
|
412
407
|
- - ">="
|
413
408
|
- !ruby/object:Gem::Version
|
414
|
-
version: '
|
409
|
+
version: '2.0'
|
415
410
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
416
411
|
requirements:
|
417
412
|
- - ">="
|
@@ -433,7 +428,6 @@ test_files:
|
|
433
428
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
434
429
|
- spec/lib/appsignal/cli/helpers_spec.rb
|
435
430
|
- spec/lib/appsignal/cli/install_spec.rb
|
436
|
-
- spec/lib/appsignal/cli/notify_of_deploy_spec.rb
|
437
431
|
- spec/lib/appsignal/cli_spec.rb
|
438
432
|
- spec/lib/appsignal/config_spec.rb
|
439
433
|
- spec/lib/appsignal/demo_spec.rb
|
@@ -477,23 +471,19 @@ test_files:
|
|
477
471
|
- spec/lib/appsignal/integrations/data_mapper_spec.rb
|
478
472
|
- spec/lib/appsignal/integrations/grape_spec.rb
|
479
473
|
- spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
|
480
|
-
- spec/lib/appsignal/integrations/object_19_spec.rb
|
481
474
|
- spec/lib/appsignal/integrations/object_spec.rb
|
482
475
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
483
476
|
- spec/lib/appsignal/integrations/que_spec.rb
|
484
477
|
- spec/lib/appsignal/integrations/railtie_spec.rb
|
485
|
-
- spec/lib/appsignal/integrations/
|
486
|
-
- spec/lib/appsignal/integrations/resque_spec.rb
|
478
|
+
- spec/lib/appsignal/integrations/sidekiq_spec.rb
|
487
479
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
488
480
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
489
|
-
- spec/lib/appsignal/js_exception_transaction_spec.rb
|
490
481
|
- spec/lib/appsignal/logger_spec.rb
|
491
482
|
- spec/lib/appsignal/marker_spec.rb
|
492
483
|
- spec/lib/appsignal/minutely_spec.rb
|
493
484
|
- spec/lib/appsignal/probes/puma_spec.rb
|
494
485
|
- spec/lib/appsignal/probes/sidekiq_spec.rb
|
495
486
|
- spec/lib/appsignal/rack/generic_instrumentation_spec.rb
|
496
|
-
- spec/lib/appsignal/rack/js_exception_catcher_spec.rb
|
497
487
|
- spec/lib/appsignal/rack/rails_instrumentation_spec.rb
|
498
488
|
- spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
|
499
489
|
- spec/lib/appsignal/rack/streaming_listener_spec.rb
|
@@ -1,131 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Appsignal
|
4
|
-
class CLI
|
5
|
-
# Command line tool to send a "Deploy Marker" for an application to
|
6
|
-
# AppSignal.
|
7
|
-
#
|
8
|
-
# Deploy markers are used on AppSignal.com to indicate changes in an
|
9
|
-
# application, "Deploy markers" indicate a deploy of an application.
|
10
|
-
#
|
11
|
-
# Incidents for exceptions and performance issues will be closed and
|
12
|
-
# reopened if they occur again in the new deploy.
|
13
|
-
#
|
14
|
-
# @note The same logic is used in the Capistrano integration. A deploy
|
15
|
-
# marker is created on each deploy.
|
16
|
-
#
|
17
|
-
# ## Options
|
18
|
-
#
|
19
|
-
# - `--environment` required. The environment of the application being
|
20
|
-
# deployed.
|
21
|
-
# - `--user` required. User that triggered the deploy.
|
22
|
-
# - `--revision` required. Git commit SHA or other identifiable revision id.
|
23
|
-
# - `--name` If no "name" config can be found in a `config/appsignal.yml`
|
24
|
-
# file or based on the `APPSIGNAL_APP_NAME` environment variable, this
|
25
|
-
# option is required.
|
26
|
-
#
|
27
|
-
# ## Exit codes
|
28
|
-
#
|
29
|
-
# - Exits with status code `0` if the deploy marker is sent.
|
30
|
-
# - Exits with status code `1` if the configuration is not valid and active.
|
31
|
-
# - Exits with status code `1` if the required options aren't present.
|
32
|
-
#
|
33
|
-
# @example basic example
|
34
|
-
# appsignal notify_of_deploy \
|
35
|
-
# --user=tom \
|
36
|
-
# --environment=production \
|
37
|
-
# --revision=abc1234
|
38
|
-
#
|
39
|
-
# @example using a custom app name
|
40
|
-
# appsignal notify_of_deploy \
|
41
|
-
# --user=tom \
|
42
|
-
# --environment=production \
|
43
|
-
# --revision=abc1234 \
|
44
|
-
# --name="My app"
|
45
|
-
#
|
46
|
-
# @example help command
|
47
|
-
# appsignal notify_of_deploy --help
|
48
|
-
#
|
49
|
-
# @deprecated This method of sending AppSignal deploy markers is
|
50
|
-
# deprecated. Use the [`revision` config option]
|
51
|
-
# (https://docs.appsignal.com/ruby/configuration/options.html#app_revision-revision)
|
52
|
-
# instead. For more information, please read the [deploy markers]
|
53
|
-
# (https://docs.appsignal.com/application/markers/deploy-markers.html)
|
54
|
-
# documentation.
|
55
|
-
# @since 0.2.5
|
56
|
-
# @see Appsignal::Marker Appsignal::Marker
|
57
|
-
# @see http://docs.appsignal.com/ruby/command-line/notify_of_deploy.html
|
58
|
-
# AppSignal notify_of_deploy documentation
|
59
|
-
# @see http://docs.appsignal.com/appsignal/terminology.html#markers
|
60
|
-
# Terminology: Deploy marker
|
61
|
-
class NotifyOfDeploy
|
62
|
-
class << self
|
63
|
-
include Appsignal::Utils::DeprecationMessage
|
64
|
-
|
65
|
-
# @param options [Hash]
|
66
|
-
# @option options :environment [String] environment to load
|
67
|
-
# configuration for.
|
68
|
-
# @option options :name [String] custom name of the application.
|
69
|
-
# @option options :user [String] user who triggered the deploy.
|
70
|
-
# @option options :revision [String] the revision that has been
|
71
|
-
# deployed. E.g. a git commit SHA.
|
72
|
-
# @return [void]
|
73
|
-
def run(options)
|
74
|
-
config = config_for(options[:environment])
|
75
|
-
config[:name] = options[:name] if options[:name]
|
76
|
-
|
77
|
-
validate_active_config(config)
|
78
|
-
required_config = [:revision, :user]
|
79
|
-
required_config << :environment if config.env.empty?
|
80
|
-
required_config << :name if !config[:name] || config[:name].empty?
|
81
|
-
validate_required_options(options, required_config)
|
82
|
-
|
83
|
-
Appsignal::Marker.new(
|
84
|
-
{
|
85
|
-
:revision => options[:revision],
|
86
|
-
:user => options[:user]
|
87
|
-
},
|
88
|
-
config
|
89
|
-
).transmit
|
90
|
-
|
91
|
-
puts
|
92
|
-
message = "This command (appsignal notify_of_deploy) has been " \
|
93
|
-
"deprecated in favor of the `revision` config option. Please " \
|
94
|
-
"see our documentation for more information on the recommended " \
|
95
|
-
"method: " \
|
96
|
-
"https://docs.appsignal.com/application/markers/deploy-markers.html"
|
97
|
-
deprecation_message message
|
98
|
-
end
|
99
|
-
|
100
|
-
private
|
101
|
-
|
102
|
-
def validate_required_options(options, required_options)
|
103
|
-
missing = required_options.select do |required_option|
|
104
|
-
val = options[required_option]
|
105
|
-
val.nil? || (val.respond_to?(:empty?) && val.empty?)
|
106
|
-
end
|
107
|
-
return unless missing.any?
|
108
|
-
|
109
|
-
puts "Error: Missing options: #{missing.join(", ")}"
|
110
|
-
exit 1
|
111
|
-
end
|
112
|
-
|
113
|
-
def validate_active_config(config)
|
114
|
-
return if config.active?
|
115
|
-
|
116
|
-
puts "Error: No valid config found."
|
117
|
-
exit 1
|
118
|
-
end
|
119
|
-
|
120
|
-
def config_for(environment)
|
121
|
-
Appsignal::Config.new(
|
122
|
-
Dir.pwd,
|
123
|
-
environment,
|
124
|
-
{},
|
125
|
-
Logger.new(StringIO.new)
|
126
|
-
)
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Object
|
4
|
-
def self.appsignal_instrument_class_method(method_name, options = {})
|
5
|
-
singleton_class.send \
|
6
|
-
:alias_method, "appsignal_uninstrumented_#{method_name}", method_name
|
7
|
-
singleton_class.send(:define_method, method_name) do |*args, &block|
|
8
|
-
name = options.fetch(:name) do
|
9
|
-
"#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
|
10
|
-
end
|
11
|
-
Appsignal.instrument name do
|
12
|
-
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.appsignal_instrument_method(method_name, options = {})
|
18
|
-
alias_method "appsignal_uninstrumented_#{method_name}", method_name
|
19
|
-
define_method method_name do |*args, &block|
|
20
|
-
name = options.fetch(:name) do
|
21
|
-
"#{method_name}.#{appsignal_reverse_class_name}.other"
|
22
|
-
end
|
23
|
-
Appsignal.instrument name do
|
24
|
-
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.appsignal_reverse_class_name
|
30
|
-
return "AnonymousClass" unless name
|
31
|
-
name.split("::").reverse.join(".")
|
32
|
-
end
|
33
|
-
|
34
|
-
def appsignal_reverse_class_name
|
35
|
-
self.class.appsignal_reverse_class_name
|
36
|
-
end
|
37
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Object
|
4
|
-
if Appsignal::System.ruby_2_7_or_newer?
|
5
|
-
def self.appsignal_instrument_class_method(method_name, options = {})
|
6
|
-
singleton_class.send \
|
7
|
-
:alias_method, "appsignal_uninstrumented_#{method_name}", method_name
|
8
|
-
singleton_class.send(:define_method, method_name) do |*args, **kwargs, &block|
|
9
|
-
name = options.fetch(:name) do
|
10
|
-
"#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
|
11
|
-
end
|
12
|
-
Appsignal.instrument name do
|
13
|
-
send "appsignal_uninstrumented_#{method_name}", *args, **kwargs, &block
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.appsignal_instrument_method(method_name, options = {})
|
19
|
-
alias_method "appsignal_uninstrumented_#{method_name}", method_name
|
20
|
-
define_method method_name do |*args, **kwargs, &block|
|
21
|
-
name = options.fetch(:name) do
|
22
|
-
"#{method_name}.#{appsignal_reverse_class_name}.other"
|
23
|
-
end
|
24
|
-
Appsignal.instrument name do
|
25
|
-
send "appsignal_uninstrumented_#{method_name}", *args, **kwargs, &block
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
else
|
30
|
-
def self.appsignal_instrument_class_method(method_name, options = {})
|
31
|
-
singleton_class.send \
|
32
|
-
:alias_method, "appsignal_uninstrumented_#{method_name}", method_name
|
33
|
-
singleton_class.send(:define_method, method_name) do |*args, &block|
|
34
|
-
name = options.fetch(:name) do
|
35
|
-
"#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
|
36
|
-
end
|
37
|
-
Appsignal.instrument name do
|
38
|
-
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.appsignal_instrument_method(method_name, options = {})
|
44
|
-
alias_method "appsignal_uninstrumented_#{method_name}", method_name
|
45
|
-
define_method method_name do |*args, &block|
|
46
|
-
name = options.fetch(:name) do
|
47
|
-
"#{method_name}.#{appsignal_reverse_class_name}.other"
|
48
|
-
end
|
49
|
-
Appsignal.instrument name do
|
50
|
-
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.appsignal_reverse_class_name
|
57
|
-
return "AnonymousClass" unless name
|
58
|
-
name.split("::").reverse.join(".")
|
59
|
-
end
|
60
|
-
|
61
|
-
def appsignal_reverse_class_name
|
62
|
-
self.class.appsignal_reverse_class_name
|
63
|
-
end
|
64
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Appsignal
|
4
|
-
module Integrations
|
5
|
-
# @api private
|
6
|
-
module ResqueActiveJobPlugin
|
7
|
-
def self.included(_)
|
8
|
-
callers = caller
|
9
|
-
Appsignal::Utils::DeprecationMessage.message \
|
10
|
-
"The AppSignal ResqueActiveJobPlugin is deprecated and does " \
|
11
|
-
"nothing on extend. In this version of the AppSignal Ruby gem " \
|
12
|
-
"the integration with Resque is automatic on all Resque workers. " \
|
13
|
-
"Please remove the following line from this file to remove this " \
|
14
|
-
"message: include Appsignal::Integrations::ResqueActiveJobPlugin\n" \
|
15
|
-
"#{callers.first}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|