appsignal 4.0.6 → 4.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/Rakefile +9 -9
  4. data/appsignal.gemspec +22 -1
  5. data/ext/agent.rb +27 -27
  6. data/lib/appsignal/check_in.rb +1 -1
  7. data/lib/appsignal/config.rb +1 -3
  8. data/lib/appsignal/integrations/resque.rb +1 -6
  9. data/lib/appsignal/utils/hash_sanitizer.rb +4 -0
  10. data/lib/appsignal/version.rb +1 -1
  11. data/lib/appsignal.rb +10 -8
  12. metadata +2 -192
  13. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
  14. data/.github/ISSUE_TEMPLATE/chore.md +0 -14
  15. data/.github/workflows/ci.yml +0 -3285
  16. data/.github/workflows/create_release_from_tag.yml +0 -62
  17. data/.gitignore +0 -35
  18. data/.gitmodules +0 -3
  19. data/.rspec +0 -4
  20. data/.yardopts +0 -8
  21. data/benchmark.rake +0 -139
  22. data/gemfiles/capistrano2.gemfile +0 -6
  23. data/gemfiles/capistrano3.gemfile +0 -7
  24. data/gemfiles/dry-monitor.gemfile +0 -5
  25. data/gemfiles/grape.gemfile +0 -5
  26. data/gemfiles/hanami-2.0.gemfile +0 -7
  27. data/gemfiles/hanami-2.1.gemfile +0 -7
  28. data/gemfiles/http5.gemfile +0 -5
  29. data/gemfiles/no_dependencies.gemfile +0 -10
  30. data/gemfiles/padrino.gemfile +0 -7
  31. data/gemfiles/psych-3.gemfile +0 -5
  32. data/gemfiles/psych-4.gemfile +0 -5
  33. data/gemfiles/que-1.gemfile +0 -5
  34. data/gemfiles/que-2.gemfile +0 -5
  35. data/gemfiles/rails-6.0.gemfile +0 -10
  36. data/gemfiles/rails-6.1.gemfile +0 -11
  37. data/gemfiles/rails-7.0.gemfile +0 -11
  38. data/gemfiles/rails-7.1.gemfile +0 -11
  39. data/gemfiles/rails-7.2.gemfile +0 -11
  40. data/gemfiles/redis-4.gemfile +0 -5
  41. data/gemfiles/redis-5.gemfile +0 -6
  42. data/gemfiles/resque-2.gemfile +0 -6
  43. data/gemfiles/sequel.gemfile +0 -10
  44. data/gemfiles/sinatra.gemfile +0 -5
  45. data/gemfiles/webmachine1.gemfile +0 -7
  46. data/gemfiles/webmachine2.gemfile +0 -6
  47. data/mono.yml +0 -16
  48. data/spec/.rubocop.yml +0 -7
  49. data/spec/lib/appsignal/auth_check_spec.rb +0 -84
  50. data/spec/lib/appsignal/capistrano2_spec.rb +0 -227
  51. data/spec/lib/appsignal/capistrano3_spec.rb +0 -284
  52. data/spec/lib/appsignal/check_in/cron_spec.rb +0 -210
  53. data/spec/lib/appsignal/check_in/scheduler_spec.rb +0 -557
  54. data/spec/lib/appsignal/cli/demo_spec.rb +0 -46
  55. data/spec/lib/appsignal/cli/diagnose/paths_spec.rb +0 -16
  56. data/spec/lib/appsignal/cli/diagnose/utils_spec.rb +0 -86
  57. data/spec/lib/appsignal/cli/diagnose_spec.rb +0 -1553
  58. data/spec/lib/appsignal/cli/helpers_spec.rb +0 -179
  59. data/spec/lib/appsignal/cli/install_spec.rb +0 -848
  60. data/spec/lib/appsignal/cli_spec.rb +0 -56
  61. data/spec/lib/appsignal/config_spec.rb +0 -1380
  62. data/spec/lib/appsignal/demo_spec.rb +0 -83
  63. data/spec/lib/appsignal/environment_spec.rb +0 -190
  64. data/spec/lib/appsignal/event_formatter/action_view/render_formatter_spec.rb +0 -60
  65. data/spec/lib/appsignal/event_formatter/active_record/instantiation_formatter_spec.rb +0 -21
  66. data/spec/lib/appsignal/event_formatter/active_record/sql_formatter_spec.rb +0 -21
  67. data/spec/lib/appsignal/event_formatter/elastic_search/search_formatter_spec.rb +0 -52
  68. data/spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb +0 -21
  69. data/spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb +0 -84
  70. data/spec/lib/appsignal/event_formatter/rom/sql_formatter_spec.rb +0 -22
  71. data/spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb +0 -30
  72. data/spec/lib/appsignal/event_formatter/view_component/render_formatter_spec.rb +0 -41
  73. data/spec/lib/appsignal/event_formatter_spec.rb +0 -193
  74. data/spec/lib/appsignal/extension/jruby_spec.rb +0 -46
  75. data/spec/lib/appsignal/extension_install_failure_spec.rb +0 -20
  76. data/spec/lib/appsignal/extension_spec.rb +0 -178
  77. data/spec/lib/appsignal/garbage_collection_spec.rb +0 -98
  78. data/spec/lib/appsignal/hooks/action_cable_spec.rb +0 -345
  79. data/spec/lib/appsignal/hooks/action_mailer_spec.rb +0 -55
  80. data/spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb +0 -23
  81. data/spec/lib/appsignal/hooks/active_support_notifications/instrument_shared_examples.rb +0 -99
  82. data/spec/lib/appsignal/hooks/active_support_notifications/start_finish_shared_examples.rb +0 -47
  83. data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +0 -47
  84. data/spec/lib/appsignal/hooks/activejob_spec.rb +0 -650
  85. data/spec/lib/appsignal/hooks/at_exit_spec.rb +0 -105
  86. data/spec/lib/appsignal/hooks/celluloid_spec.rb +0 -40
  87. data/spec/lib/appsignal/hooks/data_mapper_spec.rb +0 -40
  88. data/spec/lib/appsignal/hooks/delayed_job_spec.rb +0 -38
  89. data/spec/lib/appsignal/hooks/dry_monitor_spec.rb +0 -83
  90. data/spec/lib/appsignal/hooks/excon_spec.rb +0 -67
  91. data/spec/lib/appsignal/hooks/gvl_spec.rb +0 -145
  92. data/spec/lib/appsignal/hooks/http_spec.rb +0 -37
  93. data/spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb +0 -46
  94. data/spec/lib/appsignal/hooks/mri_spec.rb +0 -23
  95. data/spec/lib/appsignal/hooks/net_http_spec.rb +0 -18
  96. data/spec/lib/appsignal/hooks/passenger_spec.rb +0 -30
  97. data/spec/lib/appsignal/hooks/puma_spec.rb +0 -80
  98. data/spec/lib/appsignal/hooks/que_spec.rb +0 -19
  99. data/spec/lib/appsignal/hooks/rake_spec.rb +0 -144
  100. data/spec/lib/appsignal/hooks/redis_client_spec.rb +0 -218
  101. data/spec/lib/appsignal/hooks/redis_spec.rb +0 -124
  102. data/spec/lib/appsignal/hooks/resque_spec.rb +0 -27
  103. data/spec/lib/appsignal/hooks/sequel_spec.rb +0 -44
  104. data/spec/lib/appsignal/hooks/shoryuken_spec.rb +0 -29
  105. data/spec/lib/appsignal/hooks/sidekiq_spec.rb +0 -115
  106. data/spec/lib/appsignal/hooks/unicorn_spec.rb +0 -63
  107. data/spec/lib/appsignal/hooks/webmachine_spec.rb +0 -24
  108. data/spec/lib/appsignal/hooks_spec.rb +0 -124
  109. data/spec/lib/appsignal/integrations/data_mapper_spec.rb +0 -74
  110. data/spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb +0 -454
  111. data/spec/lib/appsignal/integrations/http_spec.rb +0 -111
  112. data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +0 -154
  113. data/spec/lib/appsignal/integrations/net_http_spec.rb +0 -33
  114. data/spec/lib/appsignal/integrations/object_spec.rb +0 -347
  115. data/spec/lib/appsignal/integrations/puma_spec.rb +0 -150
  116. data/spec/lib/appsignal/integrations/que_spec.rb +0 -187
  117. data/spec/lib/appsignal/integrations/railtie_spec.rb +0 -457
  118. data/spec/lib/appsignal/integrations/resque_spec.rb +0 -155
  119. data/spec/lib/appsignal/integrations/shoryuken_spec.rb +0 -165
  120. data/spec/lib/appsignal/integrations/sidekiq_spec.rb +0 -640
  121. data/spec/lib/appsignal/integrations/webmachine_spec.rb +0 -136
  122. data/spec/lib/appsignal/loaders/grape_spec.rb +0 -12
  123. data/spec/lib/appsignal/loaders/hanami_spec.rb +0 -92
  124. data/spec/lib/appsignal/loaders/padrino_spec.rb +0 -273
  125. data/spec/lib/appsignal/loaders/sinatra_spec.rb +0 -44
  126. data/spec/lib/appsignal/loaders_spec.rb +0 -144
  127. data/spec/lib/appsignal/logger_spec.rb +0 -205
  128. data/spec/lib/appsignal/marker_spec.rb +0 -51
  129. data/spec/lib/appsignal/probes/gvl_spec.rb +0 -164
  130. data/spec/lib/appsignal/probes/mri_spec.rb +0 -162
  131. data/spec/lib/appsignal/probes/sidekiq_spec.rb +0 -333
  132. data/spec/lib/appsignal/probes_spec.rb +0 -414
  133. data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +0 -370
  134. data/spec/lib/appsignal/rack/body_wrapper_spec.rb +0 -319
  135. data/spec/lib/appsignal/rack/event_handler_spec.rb +0 -441
  136. data/spec/lib/appsignal/rack/grape_middleware_spec.rb +0 -201
  137. data/spec/lib/appsignal/rack/hanami_middleware_spec.rb +0 -36
  138. data/spec/lib/appsignal/rack/instrumentation_middleware_spec.rb +0 -38
  139. data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +0 -126
  140. data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +0 -217
  141. data/spec/lib/appsignal/rack_spec.rb +0 -243
  142. data/spec/lib/appsignal/sample_data_spec.rb +0 -238
  143. data/spec/lib/appsignal/span_spec.rb +0 -141
  144. data/spec/lib/appsignal/system_spec.rb +0 -126
  145. data/spec/lib/appsignal/transaction_spec.rb +0 -2115
  146. data/spec/lib/appsignal/transmitter_spec.rb +0 -198
  147. data/spec/lib/appsignal/utils/data_spec.rb +0 -166
  148. data/spec/lib/appsignal/utils/hash_sanitizer_spec.rb +0 -182
  149. data/spec/lib/appsignal/utils/integration_logger_spec.rb +0 -21
  150. data/spec/lib/appsignal/utils/integration_memory_logger_spec.rb +0 -153
  151. data/spec/lib/appsignal/utils/json_spec.rb +0 -44
  152. data/spec/lib/appsignal/utils/query_params_sanitizer_spec.rb +0 -192
  153. data/spec/lib/appsignal_spec.rb +0 -1919
  154. data/spec/lib/puma/appsignal_spec.rb +0 -334
  155. data/spec/spec_helper.rb +0 -179
  156. data/spec/support/fixtures/generated_config.yml +0 -24
  157. data/spec/support/fixtures/projects/broken/config/appsignal.yml +0 -1
  158. data/spec/support/fixtures/projects/valid/config/appsignal.yml +0 -57
  159. data/spec/support/fixtures/projects/valid/log/.gitkeep +0 -0
  160. data/spec/support/fixtures/projects/valid_with_rails_app/config/application.rb +0 -16
  161. data/spec/support/fixtures/projects/valid_with_rails_app/config/appsignal.yml +0 -56
  162. data/spec/support/fixtures/projects/valid_with_rails_app/config/environment.rb +0 -10
  163. data/spec/support/fixtures/projects/valid_with_rails_app/log/.gitkeep +0 -0
  164. data/spec/support/fixtures/uploaded_file.txt +0 -0
  165. data/spec/support/hanami/hanami_app.rb +0 -29
  166. data/spec/support/helpers/action_mailer_helpers.rb +0 -25
  167. data/spec/support/helpers/activejob_helpers.rb +0 -27
  168. data/spec/support/helpers/api_request_helper.rb +0 -60
  169. data/spec/support/helpers/cli_helpers.rb +0 -40
  170. data/spec/support/helpers/config_helpers.rb +0 -66
  171. data/spec/support/helpers/dependency_helper.rb +0 -155
  172. data/spec/support/helpers/directory_helper.rb +0 -27
  173. data/spec/support/helpers/env_helpers.rb +0 -41
  174. data/spec/support/helpers/environment_metdata_helper.rb +0 -16
  175. data/spec/support/helpers/example_exception.rb +0 -13
  176. data/spec/support/helpers/example_standard_error.rb +0 -13
  177. data/spec/support/helpers/loader_helper.rb +0 -21
  178. data/spec/support/helpers/log_helpers.rb +0 -36
  179. data/spec/support/helpers/rails_helper.rb +0 -28
  180. data/spec/support/helpers/std_streams_helper.rb +0 -94
  181. data/spec/support/helpers/system_helpers.rb +0 -8
  182. data/spec/support/helpers/take_at_most_helper.rb +0 -21
  183. data/spec/support/helpers/time_helpers.rb +0 -11
  184. data/spec/support/helpers/transaction_helpers.rb +0 -122
  185. data/spec/support/helpers/wait_for_helper.rb +0 -39
  186. data/spec/support/matchers/contains_log.rb +0 -26
  187. data/spec/support/matchers/have_colorized_text.rb +0 -28
  188. data/spec/support/matchers/transaction.rb +0 -200
  189. data/spec/support/mocks/appsignal_mock.rb +0 -18
  190. data/spec/support/mocks/dummy_app.rb +0 -20
  191. data/spec/support/mocks/fake_gc_profiler.rb +0 -19
  192. data/spec/support/mocks/fake_gvl_tools.rb +0 -28
  193. data/spec/support/mocks/hash_like.rb +0 -10
  194. data/spec/support/mocks/mock_probe.rb +0 -13
  195. data/spec/support/mocks/puma_mock.rb +0 -43
  196. data/spec/support/shared_examples/instrument.rb +0 -48
  197. data/spec/support/stubs/appsignal/loaders/loader_stub.rb +0 -7
  198. data/spec/support/stubs/delayed_job.rb +0 -0
  199. data/spec/support/stubs/sidekiq/api.rb +0 -4
  200. data/spec/support/testing.rb +0 -203
  201. data/support/bundler_wrapper +0 -12
  202. data/support/install_deps +0 -33
@@ -1,210 +0,0 @@
1
- describe Appsignal::CheckIn::Cron do
2
- let(:log_stream) { std_stream }
3
- let(:logs) { log_contents(log_stream) }
4
- let(:appsignal_options) { {} }
5
- let(:config) { project_fixture_config }
6
- let(:cron_checkin) { described_class.new(:identifier => "cron-checkin-name") }
7
- let(:scheduler) { Appsignal::CheckIn.scheduler }
8
-
9
- before do
10
- start_agent(
11
- :options => appsignal_options,
12
- :internal_logger => test_logger(log_stream)
13
- )
14
- end
15
- after { stop_scheduler }
16
-
17
- def stop_scheduler
18
- scheduler.stop
19
- end
20
-
21
- describe "when Appsignal is not active" do
22
- let(:appsignal_options) { { :active => false } }
23
-
24
- it "does not transmit any events" do
25
- expect(Appsignal).to_not be_started
26
-
27
- cron_checkin.start
28
- cron_checkin.finish
29
- stop_scheduler
30
-
31
- expect(logs).to contains_log(
32
- :debug,
33
- /Cannot transmit cron check-in `cron-checkin-name` start event .+: AppSignal is not active/
34
- )
35
- expect(logs).to contains_log(
36
- :debug,
37
- /Cannot transmit cron check-in `cron-checkin-name` finish event .+: AppSignal is not active/
38
- )
39
- end
40
- end
41
-
42
- describe "when AppSignal is stopped" do
43
- it "does not transmit any events" do
44
- Appsignal.stop
45
-
46
- cron_checkin.start
47
- cron_checkin.finish
48
-
49
- expect(logs).to contains_log(
50
- :debug,
51
- "Cannot transmit cron check-in `cron-checkin-name` start event"
52
- )
53
- expect(logs).to contains_log(
54
- :debug,
55
- "Cannot transmit cron check-in `cron-checkin-name` finish event"
56
- )
57
- end
58
- end
59
-
60
- describe "#start" do
61
- it "sends a cron check-in start" do
62
- cron_checkin.start
63
-
64
- stub_check_in_request(
65
- :events => [
66
- "identifier" => "cron-checkin-name",
67
- "kind" => "start",
68
- "check_in_type" => "cron"
69
- ]
70
- )
71
-
72
- scheduler.stop
73
-
74
- expect(logs).to_not contains_log(:error)
75
- expect(logs).to contains_log(
76
- :debug,
77
- "Scheduling cron check-in `cron-checkin-name` start event"
78
- )
79
- expect(logs).to contains_log(
80
- :debug,
81
- "Transmitted cron check-in `cron-checkin-name` start event"
82
- )
83
- end
84
-
85
- it "logs an error if it fails" do
86
- cron_checkin.start
87
-
88
- stub_check_in_request(
89
- :events => [
90
- "identifier" => "cron-checkin-name",
91
- "kind" => "start",
92
- "check_in_type" => "cron"
93
- ],
94
- :response => { :status => 499 }
95
- )
96
-
97
- scheduler.stop
98
-
99
- expect(logs).to contains_log(
100
- :debug,
101
- "Scheduling cron check-in `cron-checkin-name` start event"
102
- )
103
- expect(logs).to contains_log(
104
- :error,
105
- /Failed to transmit cron check-in `cron-checkin-name` start event .+: 499 status code/
106
- )
107
- end
108
- end
109
-
110
- describe "#finish" do
111
- it "sends a cron check-in finish" do
112
- cron_checkin.finish
113
-
114
- stub_check_in_request(
115
- :events => [
116
- "identifier" => "cron-checkin-name",
117
- "kind" => "finish",
118
- "check_in_type" => "cron"
119
- ]
120
- )
121
-
122
- scheduler.stop
123
- expect(logs).to_not contains_log(:error)
124
- expect(logs).to contains_log(
125
- :debug,
126
- "Scheduling cron check-in `cron-checkin-name` finish event"
127
- )
128
- expect(logs).to contains_log(
129
- :debug,
130
- "Transmitted cron check-in `cron-checkin-name` finish event"
131
- )
132
- end
133
-
134
- it "logs an error if it fails" do
135
- cron_checkin.finish
136
-
137
- stub_check_in_request(
138
- :events => [
139
- "identifier" => "cron-checkin-name",
140
- "kind" => "finish",
141
- "check_in_type" => "cron"
142
- ],
143
- :response => { :status => 499 }
144
- )
145
-
146
- scheduler.stop
147
-
148
- expect(logs).to contains_log(
149
- :debug,
150
- "Scheduling cron check-in `cron-checkin-name` finish event"
151
- )
152
- expect(logs).to contains_log(
153
- :error,
154
- /Failed to transmit cron check-in `cron-checkin-name` finish event .+: 499 status code/
155
- )
156
- end
157
- end
158
-
159
- describe ".cron" do
160
- describe "when a block is given" do
161
- it "sends a cron check-in start and finish and return the block output" do
162
- stub_check_in_request(
163
- :events => [
164
- "identifier" => "cron-checkin-with-block",
165
- "kind" => "start",
166
- "check_in_type" => "cron"
167
- ]
168
- )
169
- stub_check_in_request(
170
- :events => [
171
- "identifier" => "cron-checkin-with-block",
172
- "kind" => "finish",
173
- "check_in_type" => "cron"
174
- ]
175
- )
176
-
177
- output = Appsignal::CheckIn.cron("cron-checkin-with-block") { "output" }
178
- expect(output).to eq("output")
179
- end
180
-
181
- it "does not send a cron check-in finish event when an error is raised" do
182
- stub_check_in_request(
183
- :events => [
184
- "identifier" => "cron-checkin-with-block",
185
- "kind" => "start",
186
- "check_in_type" => "cron"
187
- ]
188
- )
189
-
190
- expect do
191
- Appsignal::CheckIn.cron("cron-checkin-with-block") { raise "error" }
192
- end.to raise_error(RuntimeError, "error")
193
- end
194
- end
195
-
196
- describe "when no block is given" do
197
- it "only sends a cron check-in finish event" do
198
- stub_check_in_request(
199
- :events => [
200
- "identifier" => "cron-checkin-without-block",
201
- "kind" => "finish",
202
- "check_in_type" => "cron"
203
- ]
204
- )
205
-
206
- Appsignal::CheckIn.cron("cron-checkin-without-block")
207
- end
208
- end
209
- end
210
- end