appsignal 3.11.0 → 3.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +109 -0
- data/Rakefile +1 -1
- data/lib/appsignal/cli/diagnose.rb +1 -1
- data/lib/appsignal/config.rb +150 -32
- data/lib/appsignal/demo.rb +1 -6
- data/lib/appsignal/integrations/grape.rb +7 -0
- data/lib/appsignal/integrations/hanami.rb +8 -43
- data/lib/appsignal/integrations/padrino.rb +8 -73
- data/lib/appsignal/integrations/railtie.rb +35 -13
- data/lib/appsignal/integrations/sinatra.rb +8 -19
- data/lib/appsignal/loaders/grape.rb +13 -0
- data/lib/appsignal/loaders/hanami.rb +40 -0
- data/lib/appsignal/loaders/padrino.rb +68 -0
- data/lib/appsignal/loaders/sinatra.rb +24 -0
- data/lib/appsignal/loaders.rb +92 -0
- data/lib/appsignal/rack/abstract_middleware.rb +2 -1
- data/lib/appsignal/rack/event_handler.rb +5 -5
- data/lib/appsignal/rack.rb +6 -0
- data/lib/appsignal/version.rb +1 -1
- data/lib/appsignal.rb +163 -9
- data/spec/lib/appsignal/cli/demo_spec.rb +0 -1
- data/spec/lib/appsignal/cli/diagnose/paths_spec.rb +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +0 -1
- data/spec/lib/appsignal/config_spec.rb +153 -1
- data/spec/lib/appsignal/demo_spec.rb +1 -2
- data/spec/lib/appsignal/environment_spec.rb +4 -2
- data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +3 -6
- data/spec/lib/appsignal/hooks/activejob_spec.rb +3 -3
- data/spec/lib/appsignal/hooks/dry_monitor_spec.rb +4 -7
- data/spec/lib/appsignal/hooks/excon_spec.rb +3 -6
- data/spec/lib/appsignal/hooks/gvl_spec.rb +2 -2
- data/spec/lib/appsignal/hooks/http_spec.rb +1 -3
- data/spec/lib/appsignal/hooks/net_http_spec.rb +1 -1
- data/spec/lib/appsignal/hooks/redis_client_spec.rb +5 -8
- data/spec/lib/appsignal/hooks/redis_spec.rb +3 -6
- data/spec/lib/appsignal/hooks/resque_spec.rb +1 -1
- data/spec/lib/appsignal/hooks/sequel_spec.rb +3 -5
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +1 -1
- data/spec/lib/appsignal/hooks/webmachine_spec.rb +1 -1
- data/spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb +2 -2
- data/spec/lib/appsignal/integrations/grape_spec.rb +36 -0
- data/spec/lib/appsignal/integrations/hanami_spec.rb +9 -178
- data/spec/lib/appsignal/integrations/http_spec.rb +1 -5
- data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +4 -2
- data/spec/lib/appsignal/integrations/net_http_spec.rb +1 -1
- data/spec/lib/appsignal/integrations/object_spec.rb +1 -3
- data/spec/lib/appsignal/integrations/padrino_spec.rb +8 -330
- data/spec/lib/appsignal/integrations/railtie_spec.rb +275 -191
- data/spec/lib/appsignal/integrations/shoryuken_spec.rb +1 -1
- data/spec/lib/appsignal/integrations/sidekiq_spec.rb +11 -9
- data/spec/lib/appsignal/integrations/sinatra_spec.rb +9 -104
- data/spec/lib/appsignal/loaders/grape_spec.rb +12 -0
- data/spec/lib/appsignal/loaders/hanami_spec.rb +95 -0
- data/spec/lib/appsignal/loaders/padrino_spec.rb +277 -0
- data/spec/lib/appsignal/loaders/sinatra_spec.rb +47 -0
- data/spec/lib/appsignal/loaders_spec.rb +137 -0
- data/spec/lib/appsignal/probes/sidekiq_spec.rb +1 -1
- data/spec/lib/appsignal/probes_spec.rb +6 -5
- data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +3 -2
- data/spec/lib/appsignal/rack/event_handler_spec.rb +33 -0
- data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +1 -1
- data/spec/lib/appsignal/rack/grape_middleware_spec.rb +2 -35
- data/spec/lib/appsignal/rack/hanami_middleware_spec.rb +1 -1
- data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +3 -3
- data/spec/lib/appsignal/span_spec.rb +1 -3
- data/spec/lib/appsignal/transaction_spec.rb +4 -2
- data/spec/lib/appsignal_spec.rb +278 -26
- data/spec/lib/puma/appsignal_spec.rb +0 -3
- data/spec/spec_helper.rb +5 -4
- data/spec/support/helpers/config_helpers.rb +2 -1
- data/spec/support/helpers/loader_helper.rb +21 -0
- data/spec/support/stubs/appsignal/loaders/loader_stub.rb +7 -0
- data/spec/support/testing.rb +46 -0
- metadata +15 -2
@@ -4,6 +4,7 @@ module ConfigHelpers
|
|
4
4
|
File.join(File.dirname(__FILE__), "../fixtures/projects/valid")
|
5
5
|
)
|
6
6
|
end
|
7
|
+
module_function :project_fixture_path
|
7
8
|
|
8
9
|
def project_fixture_config( # rubocop:disable Metrics/ParameterLists
|
9
10
|
env = "production",
|
@@ -22,7 +23,7 @@ module ConfigHelpers
|
|
22
23
|
module_function :project_fixture_config, :project_fixture_path
|
23
24
|
|
24
25
|
def start_agent(env = "production")
|
25
|
-
Appsignal.
|
26
|
+
Appsignal._config = project_fixture_config(env)
|
26
27
|
Appsignal.start
|
27
28
|
end
|
28
29
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module LoaderHelper
|
2
|
+
def load_loader(name)
|
3
|
+
Appsignal.load(name)
|
4
|
+
end
|
5
|
+
|
6
|
+
def start_loader(name)
|
7
|
+
Appsignal::Loaders.instances.fetch(name).on_start
|
8
|
+
end
|
9
|
+
|
10
|
+
def unregister_loader(name)
|
11
|
+
Appsignal::Loaders.unregister(name)
|
12
|
+
end
|
13
|
+
|
14
|
+
def define_loader(name, &block)
|
15
|
+
Appsignal::Testing.registered_loaders << name
|
16
|
+
Class.new(Appsignal::Loaders::Loader) do
|
17
|
+
register name
|
18
|
+
class_eval(&block) if block_given?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/support/testing.rb
CHANGED
@@ -9,11 +9,55 @@ module Appsignal
|
|
9
9
|
@testing = true unless defined?(@testing)
|
10
10
|
@testing
|
11
11
|
end
|
12
|
+
|
13
|
+
# @api private
|
14
|
+
def clear_started!
|
15
|
+
return unless instance_variable_defined?(:@started)
|
16
|
+
|
17
|
+
remove_instance_variable(:@started)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @api private
|
21
|
+
def clear_config!
|
22
|
+
@config = nil
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
def clear!
|
27
|
+
Appsignal.internal_logger = nil
|
28
|
+
|
29
|
+
clear_started!
|
30
|
+
clear_config!
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class Config
|
35
|
+
def self.clear_loader_defaults!
|
36
|
+
@loader_defaults = nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
module Loaders
|
41
|
+
def self.clear!
|
42
|
+
Appsignal::Config.clear_loader_defaults!
|
43
|
+
loaders.reject! do |key, _value|
|
44
|
+
Appsignal::Testing.registered_loaders.include?(key)
|
45
|
+
end
|
46
|
+
@instances = nil
|
47
|
+
end
|
12
48
|
end
|
13
49
|
|
14
50
|
# @api private
|
15
51
|
module Testing
|
16
52
|
class << self
|
53
|
+
def store
|
54
|
+
@store ||= {}
|
55
|
+
end
|
56
|
+
|
57
|
+
def registered_loaders
|
58
|
+
@registered_loaders ||= Set.new
|
59
|
+
end
|
60
|
+
|
17
61
|
def without_testing
|
18
62
|
original_testing = Appsignal.testing?
|
19
63
|
Appsignal.testing = false
|
@@ -27,7 +71,9 @@ module Appsignal
|
|
27
71
|
end
|
28
72
|
|
29
73
|
def clear!
|
74
|
+
store.clear
|
30
75
|
transactions.clear
|
76
|
+
registered_loaders.clear
|
31
77
|
end
|
32
78
|
|
33
79
|
attr_writer :keep_transactions, :sample_transactions
|
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: 3.
|
4
|
+
version: 3.12.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: 2024-07-
|
13
|
+
date: 2024-07-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -266,6 +266,11 @@ files:
|
|
266
266
|
- lib/appsignal/integrations/sinatra.rb
|
267
267
|
- lib/appsignal/integrations/unicorn.rb
|
268
268
|
- lib/appsignal/integrations/webmachine.rb
|
269
|
+
- lib/appsignal/loaders.rb
|
270
|
+
- lib/appsignal/loaders/grape.rb
|
271
|
+
- lib/appsignal/loaders/hanami.rb
|
272
|
+
- lib/appsignal/loaders/padrino.rb
|
273
|
+
- lib/appsignal/loaders/sinatra.rb
|
269
274
|
- lib/appsignal/logger.rb
|
270
275
|
- lib/appsignal/marker.rb
|
271
276
|
- lib/appsignal/probes.rb
|
@@ -364,6 +369,7 @@ files:
|
|
364
369
|
- spec/lib/appsignal/hooks_spec.rb
|
365
370
|
- spec/lib/appsignal/integrations/data_mapper_spec.rb
|
366
371
|
- spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb
|
372
|
+
- spec/lib/appsignal/integrations/grape_spec.rb
|
367
373
|
- spec/lib/appsignal/integrations/hanami_spec.rb
|
368
374
|
- spec/lib/appsignal/integrations/http_spec.rb
|
369
375
|
- spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
|
@@ -376,6 +382,11 @@ files:
|
|
376
382
|
- spec/lib/appsignal/integrations/sidekiq_spec.rb
|
377
383
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
378
384
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
385
|
+
- spec/lib/appsignal/loaders/grape_spec.rb
|
386
|
+
- spec/lib/appsignal/loaders/hanami_spec.rb
|
387
|
+
- spec/lib/appsignal/loaders/padrino_spec.rb
|
388
|
+
- spec/lib/appsignal/loaders/sinatra_spec.rb
|
389
|
+
- spec/lib/appsignal/loaders_spec.rb
|
379
390
|
- spec/lib/appsignal/logger_spec.rb
|
380
391
|
- spec/lib/appsignal/marker_spec.rb
|
381
392
|
- spec/lib/appsignal/probes/gvl_spec.rb
|
@@ -427,6 +438,7 @@ files:
|
|
427
438
|
- spec/support/helpers/environment_metdata_helper.rb
|
428
439
|
- spec/support/helpers/example_exception.rb
|
429
440
|
- spec/support/helpers/example_standard_error.rb
|
441
|
+
- spec/support/helpers/loader_helper.rb
|
430
442
|
- spec/support/helpers/log_helpers.rb
|
431
443
|
- spec/support/helpers/rails_helper.rb
|
432
444
|
- spec/support/helpers/std_streams_helper.rb
|
@@ -444,6 +456,7 @@ files:
|
|
444
456
|
- spec/support/mocks/mock_probe.rb
|
445
457
|
- spec/support/rails/my_app.rb
|
446
458
|
- spec/support/shared_examples/instrument.rb
|
459
|
+
- spec/support/stubs/appsignal/loaders/loader_stub.rb
|
447
460
|
- spec/support/stubs/delayed_job.rb
|
448
461
|
- spec/support/stubs/sidekiq/api.rb
|
449
462
|
- spec/support/testing.rb
|