appsignal 4.0.5 → 4.0.7
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/CHANGELOG.md +20 -0
- data/Rakefile +9 -9
- data/appsignal.gemspec +22 -1
- data/build_matrix.yml +2 -1
- data/ext/agent.rb +27 -27
- data/lib/appsignal/check_in/scheduler.rb +3 -4
- data/lib/appsignal/check_in.rb +1 -1
- data/lib/appsignal/config.rb +1 -3
- data/lib/appsignal/integrations/que.rb +8 -2
- data/lib/appsignal/integrations/resque.rb +1 -6
- data/lib/appsignal/utils/hash_sanitizer.rb +4 -0
- data/lib/appsignal/version.rb +1 -1
- metadata +2 -191
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
- data/.github/ISSUE_TEMPLATE/chore.md +0 -14
- data/.github/workflows/ci.yml +0 -3150
- data/.github/workflows/create_release_from_tag.yml +0 -62
- data/.gitignore +0 -35
- data/.gitmodules +0 -3
- data/.rspec +0 -4
- data/.yardopts +0 -8
- data/benchmark.rake +0 -139
- data/gemfiles/capistrano2.gemfile +0 -6
- data/gemfiles/capistrano3.gemfile +0 -7
- data/gemfiles/dry-monitor.gemfile +0 -5
- data/gemfiles/grape.gemfile +0 -5
- data/gemfiles/hanami-2.0.gemfile +0 -7
- data/gemfiles/hanami-2.1.gemfile +0 -7
- data/gemfiles/http5.gemfile +0 -5
- data/gemfiles/no_dependencies.gemfile +0 -10
- data/gemfiles/padrino.gemfile +0 -7
- data/gemfiles/psych-3.gemfile +0 -5
- data/gemfiles/psych-4.gemfile +0 -5
- data/gemfiles/que.gemfile +0 -5
- data/gemfiles/rails-6.0.gemfile +0 -10
- data/gemfiles/rails-6.1.gemfile +0 -11
- data/gemfiles/rails-7.0.gemfile +0 -11
- data/gemfiles/rails-7.1.gemfile +0 -11
- data/gemfiles/rails-7.2.gemfile +0 -11
- data/gemfiles/redis-4.gemfile +0 -5
- data/gemfiles/redis-5.gemfile +0 -6
- data/gemfiles/resque-2.gemfile +0 -6
- data/gemfiles/sequel.gemfile +0 -10
- data/gemfiles/sinatra.gemfile +0 -5
- data/gemfiles/webmachine1.gemfile +0 -7
- data/gemfiles/webmachine2.gemfile +0 -6
- data/mono.yml +0 -16
- data/spec/.rubocop.yml +0 -7
- data/spec/lib/appsignal/auth_check_spec.rb +0 -84
- data/spec/lib/appsignal/capistrano2_spec.rb +0 -227
- data/spec/lib/appsignal/capistrano3_spec.rb +0 -284
- data/spec/lib/appsignal/check_in/cron_spec.rb +0 -202
- data/spec/lib/appsignal/check_in/scheduler_spec.rb +0 -443
- data/spec/lib/appsignal/cli/demo_spec.rb +0 -46
- data/spec/lib/appsignal/cli/diagnose/paths_spec.rb +0 -16
- data/spec/lib/appsignal/cli/diagnose/utils_spec.rb +0 -86
- data/spec/lib/appsignal/cli/diagnose_spec.rb +0 -1553
- data/spec/lib/appsignal/cli/helpers_spec.rb +0 -179
- data/spec/lib/appsignal/cli/install_spec.rb +0 -848
- data/spec/lib/appsignal/cli_spec.rb +0 -56
- data/spec/lib/appsignal/config_spec.rb +0 -1380
- data/spec/lib/appsignal/demo_spec.rb +0 -83
- data/spec/lib/appsignal/environment_spec.rb +0 -190
- data/spec/lib/appsignal/event_formatter/action_view/render_formatter_spec.rb +0 -60
- data/spec/lib/appsignal/event_formatter/active_record/instantiation_formatter_spec.rb +0 -21
- data/spec/lib/appsignal/event_formatter/active_record/sql_formatter_spec.rb +0 -21
- data/spec/lib/appsignal/event_formatter/elastic_search/search_formatter_spec.rb +0 -52
- data/spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb +0 -21
- data/spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb +0 -84
- data/spec/lib/appsignal/event_formatter/rom/sql_formatter_spec.rb +0 -22
- data/spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb +0 -30
- data/spec/lib/appsignal/event_formatter/view_component/render_formatter_spec.rb +0 -41
- data/spec/lib/appsignal/event_formatter_spec.rb +0 -193
- data/spec/lib/appsignal/extension/jruby_spec.rb +0 -46
- data/spec/lib/appsignal/extension_install_failure_spec.rb +0 -20
- data/spec/lib/appsignal/extension_spec.rb +0 -178
- data/spec/lib/appsignal/garbage_collection_spec.rb +0 -98
- data/spec/lib/appsignal/hooks/action_cable_spec.rb +0 -345
- data/spec/lib/appsignal/hooks/action_mailer_spec.rb +0 -55
- data/spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb +0 -23
- data/spec/lib/appsignal/hooks/active_support_notifications/instrument_shared_examples.rb +0 -99
- data/spec/lib/appsignal/hooks/active_support_notifications/start_finish_shared_examples.rb +0 -47
- data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +0 -47
- data/spec/lib/appsignal/hooks/activejob_spec.rb +0 -650
- data/spec/lib/appsignal/hooks/at_exit_spec.rb +0 -105
- data/spec/lib/appsignal/hooks/celluloid_spec.rb +0 -40
- data/spec/lib/appsignal/hooks/data_mapper_spec.rb +0 -40
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +0 -38
- data/spec/lib/appsignal/hooks/dry_monitor_spec.rb +0 -83
- data/spec/lib/appsignal/hooks/excon_spec.rb +0 -67
- data/spec/lib/appsignal/hooks/gvl_spec.rb +0 -145
- data/spec/lib/appsignal/hooks/http_spec.rb +0 -37
- data/spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb +0 -46
- data/spec/lib/appsignal/hooks/mri_spec.rb +0 -23
- data/spec/lib/appsignal/hooks/net_http_spec.rb +0 -18
- data/spec/lib/appsignal/hooks/passenger_spec.rb +0 -30
- data/spec/lib/appsignal/hooks/puma_spec.rb +0 -80
- data/spec/lib/appsignal/hooks/que_spec.rb +0 -19
- data/spec/lib/appsignal/hooks/rake_spec.rb +0 -144
- data/spec/lib/appsignal/hooks/redis_client_spec.rb +0 -218
- data/spec/lib/appsignal/hooks/redis_spec.rb +0 -124
- data/spec/lib/appsignal/hooks/resque_spec.rb +0 -27
- data/spec/lib/appsignal/hooks/sequel_spec.rb +0 -44
- data/spec/lib/appsignal/hooks/shoryuken_spec.rb +0 -29
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +0 -115
- data/spec/lib/appsignal/hooks/unicorn_spec.rb +0 -63
- data/spec/lib/appsignal/hooks/webmachine_spec.rb +0 -24
- data/spec/lib/appsignal/hooks_spec.rb +0 -124
- data/spec/lib/appsignal/integrations/data_mapper_spec.rb +0 -74
- data/spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb +0 -454
- data/spec/lib/appsignal/integrations/http_spec.rb +0 -111
- data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +0 -154
- data/spec/lib/appsignal/integrations/net_http_spec.rb +0 -33
- data/spec/lib/appsignal/integrations/object_spec.rb +0 -347
- data/spec/lib/appsignal/integrations/puma_spec.rb +0 -150
- data/spec/lib/appsignal/integrations/que_spec.rb +0 -152
- data/spec/lib/appsignal/integrations/railtie_spec.rb +0 -457
- data/spec/lib/appsignal/integrations/resque_spec.rb +0 -155
- data/spec/lib/appsignal/integrations/shoryuken_spec.rb +0 -165
- data/spec/lib/appsignal/integrations/sidekiq_spec.rb +0 -640
- data/spec/lib/appsignal/integrations/webmachine_spec.rb +0 -136
- data/spec/lib/appsignal/loaders/grape_spec.rb +0 -12
- data/spec/lib/appsignal/loaders/hanami_spec.rb +0 -92
- data/spec/lib/appsignal/loaders/padrino_spec.rb +0 -273
- data/spec/lib/appsignal/loaders/sinatra_spec.rb +0 -44
- data/spec/lib/appsignal/loaders_spec.rb +0 -144
- data/spec/lib/appsignal/logger_spec.rb +0 -205
- data/spec/lib/appsignal/marker_spec.rb +0 -51
- data/spec/lib/appsignal/probes/gvl_spec.rb +0 -164
- data/spec/lib/appsignal/probes/mri_spec.rb +0 -162
- data/spec/lib/appsignal/probes/sidekiq_spec.rb +0 -333
- data/spec/lib/appsignal/probes_spec.rb +0 -411
- data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +0 -370
- data/spec/lib/appsignal/rack/body_wrapper_spec.rb +0 -319
- data/spec/lib/appsignal/rack/event_handler_spec.rb +0 -441
- data/spec/lib/appsignal/rack/grape_middleware_spec.rb +0 -201
- data/spec/lib/appsignal/rack/hanami_middleware_spec.rb +0 -36
- data/spec/lib/appsignal/rack/instrumentation_middleware_spec.rb +0 -38
- data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +0 -126
- data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +0 -217
- data/spec/lib/appsignal/rack_spec.rb +0 -243
- data/spec/lib/appsignal/sample_data_spec.rb +0 -238
- data/spec/lib/appsignal/span_spec.rb +0 -141
- data/spec/lib/appsignal/system_spec.rb +0 -126
- data/spec/lib/appsignal/transaction_spec.rb +0 -2111
- data/spec/lib/appsignal/transmitter_spec.rb +0 -198
- data/spec/lib/appsignal/utils/data_spec.rb +0 -166
- data/spec/lib/appsignal/utils/hash_sanitizer_spec.rb +0 -182
- data/spec/lib/appsignal/utils/integration_logger_spec.rb +0 -21
- data/spec/lib/appsignal/utils/integration_memory_logger_spec.rb +0 -153
- data/spec/lib/appsignal/utils/json_spec.rb +0 -44
- data/spec/lib/appsignal/utils/query_params_sanitizer_spec.rb +0 -192
- data/spec/lib/appsignal_spec.rb +0 -1919
- data/spec/lib/puma/appsignal_spec.rb +0 -334
- data/spec/spec_helper.rb +0 -173
- data/spec/support/fixtures/generated_config.yml +0 -24
- data/spec/support/fixtures/projects/broken/config/appsignal.yml +0 -1
- data/spec/support/fixtures/projects/valid/config/appsignal.yml +0 -57
- data/spec/support/fixtures/projects/valid/log/.gitkeep +0 -0
- data/spec/support/fixtures/projects/valid_with_rails_app/config/application.rb +0 -16
- data/spec/support/fixtures/projects/valid_with_rails_app/config/appsignal.yml +0 -56
- data/spec/support/fixtures/projects/valid_with_rails_app/config/environment.rb +0 -10
- data/spec/support/fixtures/projects/valid_with_rails_app/log/.gitkeep +0 -0
- data/spec/support/fixtures/uploaded_file.txt +0 -0
- data/spec/support/hanami/hanami_app.rb +0 -29
- data/spec/support/helpers/action_mailer_helpers.rb +0 -25
- data/spec/support/helpers/activejob_helpers.rb +0 -27
- data/spec/support/helpers/api_request_helper.rb +0 -20
- data/spec/support/helpers/cli_helpers.rb +0 -40
- data/spec/support/helpers/config_helpers.rb +0 -66
- data/spec/support/helpers/dependency_helper.rb +0 -150
- data/spec/support/helpers/directory_helper.rb +0 -27
- data/spec/support/helpers/env_helpers.rb +0 -41
- data/spec/support/helpers/environment_metdata_helper.rb +0 -16
- data/spec/support/helpers/example_exception.rb +0 -13
- data/spec/support/helpers/example_standard_error.rb +0 -13
- data/spec/support/helpers/loader_helper.rb +0 -21
- data/spec/support/helpers/log_helpers.rb +0 -36
- data/spec/support/helpers/rails_helper.rb +0 -28
- data/spec/support/helpers/std_streams_helper.rb +0 -94
- data/spec/support/helpers/system_helpers.rb +0 -8
- data/spec/support/helpers/take_at_most_helper.rb +0 -21
- data/spec/support/helpers/time_helpers.rb +0 -11
- data/spec/support/helpers/transaction_helpers.rb +0 -122
- data/spec/support/helpers/wait_for_helper.rb +0 -39
- data/spec/support/matchers/contains_log.rb +0 -26
- data/spec/support/matchers/have_colorized_text.rb +0 -28
- data/spec/support/matchers/transaction.rb +0 -200
- data/spec/support/mocks/appsignal_mock.rb +0 -18
- data/spec/support/mocks/dummy_app.rb +0 -20
- data/spec/support/mocks/fake_gc_profiler.rb +0 -19
- data/spec/support/mocks/fake_gvl_tools.rb +0 -28
- data/spec/support/mocks/hash_like.rb +0 -10
- data/spec/support/mocks/mock_probe.rb +0 -13
- data/spec/support/mocks/puma_mock.rb +0 -43
- data/spec/support/shared_examples/instrument.rb +0 -48
- data/spec/support/stubs/appsignal/loaders/loader_stub.rb +0 -7
- data/spec/support/stubs/delayed_job.rb +0 -0
- data/spec/support/stubs/sidekiq/api.rb +0 -4
- data/spec/support/testing.rb +0 -194
- data/support/bundler_wrapper +0 -12
- data/support/install_deps +0 -33
data/spec/support/testing.rb
DELETED
@@ -1,194 +0,0 @@
|
|
1
|
-
module Appsignal
|
2
|
-
class << self
|
3
|
-
attr_writer :testing
|
4
|
-
|
5
|
-
remove_method :testing?
|
6
|
-
|
7
|
-
# @api private
|
8
|
-
def testing?
|
9
|
-
@testing = true unless defined?(@testing)
|
10
|
-
@testing
|
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
|
48
|
-
end
|
49
|
-
|
50
|
-
# @api private
|
51
|
-
module Testing
|
52
|
-
class << self
|
53
|
-
def store
|
54
|
-
@store ||= {}
|
55
|
-
end
|
56
|
-
|
57
|
-
def registered_loaders
|
58
|
-
@registered_loaders ||= Set.new
|
59
|
-
end
|
60
|
-
|
61
|
-
def without_testing
|
62
|
-
original_testing = Appsignal.testing?
|
63
|
-
Appsignal.testing = false
|
64
|
-
yield
|
65
|
-
ensure
|
66
|
-
Appsignal.testing = original_testing
|
67
|
-
end
|
68
|
-
|
69
|
-
def transactions
|
70
|
-
@transactions ||= []
|
71
|
-
end
|
72
|
-
|
73
|
-
def clear!
|
74
|
-
store.clear
|
75
|
-
transactions.clear
|
76
|
-
registered_loaders.clear
|
77
|
-
end
|
78
|
-
|
79
|
-
attr_writer :keep_transactions, :sample_transactions
|
80
|
-
|
81
|
-
# @see TransactionHelpers#keep_transactions
|
82
|
-
def keep_transactions?
|
83
|
-
defined?(@keep_transactions) ? @keep_transactions : nil
|
84
|
-
end
|
85
|
-
|
86
|
-
# @see TransactionHelpers#keep_transactions
|
87
|
-
def sample_transactions?
|
88
|
-
sample = defined?(@sample_transactions) ? @sample_transactions : nil
|
89
|
-
if sample.nil?
|
90
|
-
keep_transactions?
|
91
|
-
else
|
92
|
-
@sample_transactions
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
class Extension
|
99
|
-
class Transaction
|
100
|
-
if Appsignal.extension_loaded?
|
101
|
-
attr_reader :queue_start
|
102
|
-
alias original_set_queue_start set_queue_start
|
103
|
-
# Temporary helper until the extension returns this information
|
104
|
-
# https://github.com/appsignal/appsignal-agent/issues/293
|
105
|
-
def set_queue_start(start) # rubocop:disable Naming/AccessorMethodName
|
106
|
-
@queue_start = start
|
107
|
-
original_set_queue_start(start)
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
alias original_finish finish if method_defined? :finish
|
112
|
-
|
113
|
-
# Override default {Extension::Transaction#finish} behavior to always
|
114
|
-
# return true, which tells the transaction to add its sample data (unless
|
115
|
-
# used in combination with {TransactionHelpers#keep_transactions}
|
116
|
-
# `:sample => false`). This allows us to use
|
117
|
-
# {Appsignal::Transaction#to_h} without relying on the extension sampling
|
118
|
-
# behavior.
|
119
|
-
#
|
120
|
-
# @see TransactionHelpers#keep_transactions
|
121
|
-
def finish(*args)
|
122
|
-
return_value = original_finish(*args)
|
123
|
-
return_value = true if Appsignal::Testing.sample_transactions?
|
124
|
-
return_value
|
125
|
-
end
|
126
|
-
|
127
|
-
alias original_complete complete if method_defined? :complete
|
128
|
-
|
129
|
-
# Override default {Extension::Transaction#complete} behavior to
|
130
|
-
# store the transaction JSON before the transaction is completed
|
131
|
-
# and it's no longer possible to request the transaction JSON.
|
132
|
-
#
|
133
|
-
# @see TransactionHelpers#keep_transactions
|
134
|
-
# @see #_completed?
|
135
|
-
def complete
|
136
|
-
@completed = true # see {#_completed?} method
|
137
|
-
@transaction_json = to_json if Appsignal::Testing.keep_transactions?
|
138
|
-
original_complete
|
139
|
-
end
|
140
|
-
|
141
|
-
# Returns true when the Transaction was completed.
|
142
|
-
# {Appsignal::Extension::Transaction.complete} was called.
|
143
|
-
#
|
144
|
-
# @return [Boolean] returns if the transaction was completed.
|
145
|
-
def _completed?
|
146
|
-
@completed || false
|
147
|
-
end
|
148
|
-
|
149
|
-
alias original_to_json to_json if method_defined? :to_json
|
150
|
-
|
151
|
-
# Override default {Extension::Transaction#to_json} behavior to
|
152
|
-
# return the stored the transaction JSON when the transaction was
|
153
|
-
# completed.
|
154
|
-
#
|
155
|
-
# @see TransactionHelpers#keep_transactions
|
156
|
-
def to_json # rubocop:disable Lint/ToJSON
|
157
|
-
if defined? @transaction_json
|
158
|
-
@transaction_json
|
159
|
-
else
|
160
|
-
original_to_json
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
module AppsignalTest
|
168
|
-
module Transaction
|
169
|
-
module ClassMethods
|
170
|
-
def self.extended(base)
|
171
|
-
base.attr_reader :ext, :error_blocks
|
172
|
-
end
|
173
|
-
|
174
|
-
# Override the {Appsignal::Transaction.new} method so we can track which
|
175
|
-
# transactions are created on the {Appsignal::Testing.transactions} list.
|
176
|
-
#
|
177
|
-
# @see TransactionHelpers#last_transaction
|
178
|
-
def new(...)
|
179
|
-
transaction = super
|
180
|
-
Appsignal::Testing.transactions << transaction
|
181
|
-
transaction
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
module InstanceMethods
|
186
|
-
def _sample
|
187
|
-
sample_data
|
188
|
-
end
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
Appsignal::Transaction.extend(AppsignalTest::Transaction::ClassMethods)
|
194
|
-
Appsignal::Transaction.prepend(AppsignalTest::Transaction::InstanceMethods)
|
data/support/bundler_wrapper
DELETED
data/support/install_deps
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
set -eu
|
4
|
-
|
5
|
-
gem_args="--no-verbose --no-document"
|
6
|
-
|
7
|
-
# Workaround for https://github.com/jruby/jruby/issues/7059
|
8
|
-
if [[ "${RUBY_VERSION}" == *"jruby"* ]]; then
|
9
|
-
echo "Skipping rubygems and bundler update for JRuby"
|
10
|
-
exit 0
|
11
|
-
fi
|
12
|
-
|
13
|
-
case "${_RUBYGEMS_VERSION-"latest"}" in
|
14
|
-
"latest")
|
15
|
-
echo "Updating rubygems"
|
16
|
-
retry --times 5 --sleep 5 gem update $gem_args --system
|
17
|
-
;;
|
18
|
-
*)
|
19
|
-
echo "Updating rubygems to $_RUBYGEMS_VERSION}"
|
20
|
-
retry --times 5 --sleep 5 gem update $gem_args --system $_RUBYGEMS_VERSION
|
21
|
-
;;
|
22
|
-
esac
|
23
|
-
|
24
|
-
case "${_BUNDLER_VERSION-"latest"}" in
|
25
|
-
"latest")
|
26
|
-
echo "Updating bundler"
|
27
|
-
retry --times 5 --sleep 5 gem update bundler $gem_args
|
28
|
-
;;
|
29
|
-
*)
|
30
|
-
echo "Updating bundler to $_BUNDLER_VERSION"
|
31
|
-
retry --times 5 --sleep 5 gem install bundler $gem_args --version $_BUNDLER_VERSION
|
32
|
-
;;
|
33
|
-
esac
|