appsignal 2.9.17 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +0 -6
  3. data/CHANGELOG.md +24 -0
  4. data/Rakefile +16 -2
  5. data/ext/agent.yml +19 -19
  6. data/lib/appsignal/cli.rb +9 -2
  7. data/lib/appsignal/cli/diagnose.rb +20 -19
  8. data/lib/appsignal/cli/helpers.rb +22 -10
  9. data/lib/appsignal/cli/install.rb +2 -1
  10. data/lib/appsignal/config.rb +23 -9
  11. data/lib/appsignal/event_formatter.rb +4 -4
  12. data/lib/appsignal/minutely.rb +4 -4
  13. data/lib/appsignal/rack/js_exception_catcher.rb +6 -0
  14. data/lib/appsignal/transaction.rb +1 -1
  15. data/lib/appsignal/version.rb +1 -1
  16. data/spec/lib/appsignal/cli/diagnose_spec.rb +54 -11
  17. data/spec/lib/appsignal/cli/helpers_spec.rb +11 -3
  18. data/spec/lib/appsignal/cli/install_spec.rb +30 -1
  19. data/spec/lib/appsignal/config_spec.rb +78 -7
  20. data/spec/lib/appsignal/hooks/action_cable_spec.rb +1 -5
  21. data/spec/lib/appsignal/hooks/rake_spec.rb +41 -39
  22. data/spec/lib/appsignal/hooks/sidekiq_spec.rb +2 -15
  23. data/spec/lib/appsignal/integrations/object_spec.rb +2 -2
  24. data/spec/lib/appsignal/integrations/que_spec.rb +26 -39
  25. data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +108 -46
  26. data/spec/lib/appsignal/integrations/resque_spec.rb +40 -39
  27. data/spec/lib/appsignal/minutely_spec.rb +3 -3
  28. data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +19 -5
  29. data/spec/lib/appsignal/transaction_spec.rb +4 -12
  30. data/spec/lib/appsignal_spec.rb +7 -8
  31. data/spec/spec_helper.rb +11 -11
  32. data/spec/support/fixtures/projects/broken/config/appsignal.yml +1 -0
  33. data/spec/support/helpers/cli_helpers.rb +15 -1
  34. data/spec/support/helpers/transaction_helpers.rb +53 -0
  35. data/spec/support/matchers/be_completed.rb +5 -0
  36. data/spec/support/matchers/have_colorized_text.rb +28 -0
  37. data/spec/support/testing.rb +113 -0
  38. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ea105e6dd4c3e9e9a6f8e5a5df0304bbc438932c820eadd4008548d02beadf9
4
- data.tar.gz: 767b716c1860e4a8a6809f5765b8a6b5e97d3fe682f2d8cd8d797c1226b473bc
3
+ metadata.gz: 4dcc9f0ae3d601a8d8a7851943568176af63fc2aae714f996449227607a74fee
4
+ data.tar.gz: c5a44f8e88184697b7ae5ccd56bb13451a64e5fc51eb427fb04ee01c77aaf7ba
5
5
  SHA512:
6
- metadata.gz: 7ff2cb1442967bc7e07a50c399d690c1a638a7ceff73e4c093f6157c4b84e3541333f3b169ed69e4574dd2904d07a38f3b737557f0d3c4d800ad7d074671b670
7
- data.tar.gz: a06dcd00bb6644394795ce844ea9f1677e68e1b7c3c89ca2c289fc6c313fb5c8cecc6cd56453b3c7666a8c760261f1f3ec08ac74270ba17a20f1d30c690f51a3
6
+ metadata.gz: 71b733951dfa43726b103e3ba39e5898e68009063b97d74d7382c1f7a0687754dba9e3954da5a3f7e5646ef1871c6ef643e238afac4319b787413fe58822a91a
7
+ data.tar.gz: e0995a18c18ee86162d7a4bc33e046f6b3a956f955c9b6f61f0bc188a161dd222983abc26852ce69bfac0008447612702c587134b010b432dfe449c70b6f1c9d
@@ -89,12 +89,6 @@ Style/ClassAndModuleChildren:
89
89
  Exclude:
90
90
  - 'lib/appsignal/integrations/padrino.rb'
91
91
 
92
- # Offense count: 6
93
- Style/ClassVars:
94
- Exclude:
95
- - 'lib/appsignal/event_formatter.rb'
96
- - 'lib/appsignal/minutely.rb'
97
-
98
92
  # Offense count: 1
99
93
  Style/DoubleNegation:
100
94
  Exclude:
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.10.0
4
+ - Rescue errors while parsing `appsignal.yml` file. It will prints a warning
5
+ instead. PR #517
6
+ - Refactoring: Reduce class variable usage. PR #520
7
+ - Bump log level about starting new transactions while a transaction is already
8
+ active from debug to a warning. PR #525
9
+ - Refactoring: Add internal AppSignal test helpers and other test suite
10
+ refactorings. PR #536, #537, #538, #539
11
+ - Fix internal Rakefile loading on Ruby 1.9.3. PR #541
12
+ - Add a `--no-color` option to the `appsignal install` command. PR #550
13
+ - Add output coloring to `appsignal diagnose` warnings. PR #551
14
+ - Add validation for empty Push API key. Empty Push API key values will no
15
+ longer start AppSignal. PR #569
16
+ - Deprecate the JSExceptionCatcher middleware in favor of our new front-end
17
+ JavaScript integration (https://docs.appsignal.com/front-end/). PR #572
18
+
19
+ ## 2.9.18
20
+ - Bump agent to v-c348132
21
+ - Improve transmitter logging on timeout
22
+ - Improve queued payloads transmitter. Should prevent payloads being sent
23
+ multiple times.
24
+ - Add transaction debug mode
25
+ - Wrap Option in Mutex in TransactionInProgess
26
+
3
27
  ## 2.9.17
4
28
  - Handle missing file and load errors from `application.rb` in `appsignal
5
29
  install` for Rails apps. PR #568
data/Rakefile CHANGED
@@ -143,9 +143,23 @@ namespace :build do
143
143
  end
144
144
  end
145
145
 
146
+ def define_build_task(task_name, base_gemspec, &block)
147
+ Gem::PackageTask.new(base_gemspec, &block)
148
+ rescue StandardError => error
149
+ puts "Warning: An error occurred defining `build:#{task_name}:gem` Rake task."
150
+ puts "This task will not be availble."
151
+ if ENV["DEBUG"]
152
+ puts "#{error}: #{error.message}"
153
+ puts error.backtrace
154
+ else
155
+ puts "For more information, run the same command with `DEBUG=true`."
156
+ end
157
+ puts
158
+ end
159
+
146
160
  namespace :ruby do
147
161
  # Extension default set in `appsignal.gemspec`
148
- Gem::PackageTask.new(base_gemspec) { |_pkg| }
162
+ define_build_task(:ruby, base_gemspec) { |_pkg| }
149
163
  end
150
164
 
151
165
  namespace :jruby do
@@ -157,7 +171,7 @@ namespace :build do
157
171
  s.add_dependency "ffi"
158
172
  end
159
173
 
160
- Gem::PackageTask.new(spec) { |_pkg| }
174
+ define_build_task(:jruby, spec) { |_pkg| }
161
175
  end
162
176
 
163
177
  desc "Build all gem versions"
@@ -1,70 +1,70 @@
1
1
  ---
2
- version: 1d8917f
2
+ version: c348132
3
3
  mirrors:
4
4
  - https://appsignal-agent-releases.global.ssl.fastly.net
5
5
  - https://d135dj0rjqvssy.cloudfront.net
6
6
  triples:
7
7
  x86_64-darwin:
8
8
  static:
9
- checksum: 777cf5c54eeb32d9d0d6de48c61f14d977244351a4a9e70c9b30c4221e38012c
9
+ checksum: cb287c8e2072fe5b8cf14449bd6892989c392d0c651ce339895ae0302cb69785
10
10
  filename: appsignal-x86_64-darwin-all-static.tar.gz
11
11
  dynamic:
12
- checksum: 2741e747961dbac985f5740c3c747c7a76ce88452a37604ae8c8588343a08464
12
+ checksum: af1ed2e9d29859ffbfc8e6903e4c51764dee94d7b4877ca8d30270b6f133a10f
13
13
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
14
14
  universal-darwin:
15
15
  static:
16
- checksum: 777cf5c54eeb32d9d0d6de48c61f14d977244351a4a9e70c9b30c4221e38012c
16
+ checksum: cb287c8e2072fe5b8cf14449bd6892989c392d0c651ce339895ae0302cb69785
17
17
  filename: appsignal-x86_64-darwin-all-static.tar.gz
18
18
  dynamic:
19
- checksum: 2741e747961dbac985f5740c3c747c7a76ce88452a37604ae8c8588343a08464
19
+ checksum: af1ed2e9d29859ffbfc8e6903e4c51764dee94d7b4877ca8d30270b6f133a10f
20
20
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
21
21
  i686-linux:
22
22
  static:
23
- checksum: 483417f3afbc76b959d68137717b85d44e9dd14c56bad3a44fd370294dc86273
23
+ checksum: 2c3bcd102592bf38fbdb27e7c70502dccbe54a0dc2739a9d54aaa694fcfb41fb
24
24
  filename: appsignal-i686-linux-all-static.tar.gz
25
25
  dynamic:
26
- checksum: b34d007f69eea87a197e5bc8b0cd22f512dc37b732c2ae8c49f053c70c291d2c
26
+ checksum: 1c037b8370b755d706340e25d3e4b2f4acb279dd03873cc53bcf0a6ec0832653
27
27
  filename: appsignal-i686-linux-all-dynamic.tar.gz
28
28
  x86-linux:
29
29
  static:
30
- checksum: 483417f3afbc76b959d68137717b85d44e9dd14c56bad3a44fd370294dc86273
30
+ checksum: 2c3bcd102592bf38fbdb27e7c70502dccbe54a0dc2739a9d54aaa694fcfb41fb
31
31
  filename: appsignal-i686-linux-all-static.tar.gz
32
32
  dynamic:
33
- checksum: b34d007f69eea87a197e5bc8b0cd22f512dc37b732c2ae8c49f053c70c291d2c
33
+ checksum: 1c037b8370b755d706340e25d3e4b2f4acb279dd03873cc53bcf0a6ec0832653
34
34
  filename: appsignal-i686-linux-all-dynamic.tar.gz
35
35
  i686-linux-musl:
36
36
  static:
37
- checksum: ad58fec875496aae76c870e5a1abdf37af27e4d237fc791c4820ef8ccfa05586
37
+ checksum: 0add9eed4452feda7fc5e1bbd0acdff32c353e4ea0b5d527959df57deb1bdcb2
38
38
  filename: appsignal-i686-linux-musl-all-static.tar.gz
39
39
  x86-linux-musl:
40
40
  static:
41
- checksum: ad58fec875496aae76c870e5a1abdf37af27e4d237fc791c4820ef8ccfa05586
41
+ checksum: 0add9eed4452feda7fc5e1bbd0acdff32c353e4ea0b5d527959df57deb1bdcb2
42
42
  filename: appsignal-i686-linux-musl-all-static.tar.gz
43
43
  x86_64-linux:
44
44
  static:
45
- checksum: dcab7852e81cbacb0a187cb62ce2f583f3ff835fb7c49c09f4e41df64b4b81c5
45
+ checksum: d11221c127c00128da16b419c503281407e429c0ea6f5bfe1691640b8e995e4e
46
46
  filename: appsignal-x86_64-linux-all-static.tar.gz
47
47
  dynamic:
48
- checksum: 33523662808254ae1e630e33a2466bf17acfb636e3726d98d11b375619ea2cdf
48
+ checksum: 6869ab461fde55487d55805c396d55f36cb881998556f44236035b949939b0af
49
49
  filename: appsignal-x86_64-linux-all-dynamic.tar.gz
50
50
  x86_64-linux-musl:
51
51
  static:
52
- checksum: 63cb4ac3d8befaec47eb907b1ff4c6c4af93e39fd7696db783cb6e656dda297c
52
+ checksum: 7ce44dc23c578933ca37a79d244bc367fdc2438408c2a61558adb92bcfebb1fa
53
53
  filename: appsignal-x86_64-linux-musl-all-static.tar.gz
54
54
  dynamic:
55
- checksum: 4116c2757c2be2b8eb259d787034ec4ab4123889735ded1ef584afbd68a8247a
55
+ checksum: 78d98f468e3a12cc09baff9e68bc4d9cd3b79f4a3bbe744036bff685415546a4
56
56
  filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
57
57
  x86_64-freebsd:
58
58
  static:
59
- checksum: 39c006dd131d1ca452ff79ec988688a69823e0abf26ee6966b1639cc42720416
59
+ checksum: df5f8b61e6ecca40f349cf5c83d5f37f031850d367793dee90dc56f13974431d
60
60
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
61
61
  dynamic:
62
- checksum: 937fb029f9f6a57aa818d46dcf8fbbfe06481c0765ad591859fbc6970a32a1df
62
+ checksum: 30d0303e97386014640c5b8194b777a5741e08ab5497ba58a7d8229bd4890fc5
63
63
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
64
64
  amd64-freebsd:
65
65
  static:
66
- checksum: 39c006dd131d1ca452ff79ec988688a69823e0abf26ee6966b1639cc42720416
66
+ checksum: df5f8b61e6ecca40f349cf5c83d5f37f031850d367793dee90dc56f13974431d
67
67
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
68
68
  dynamic:
69
- checksum: 937fb029f9f6a57aa818d46dcf8fbbfe06481c0765ad591859fbc6970a32a1df
69
+ checksum: 30d0303e97386014640c5b8194b777a5741e08ab5497ba58a7d8229bd4890fc5
70
70
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
@@ -32,7 +32,7 @@ module Appsignal
32
32
  when :diagnose
33
33
  Appsignal::CLI::Diagnose.run(options)
34
34
  when :install
35
- Appsignal::CLI::Install.run(argv.shift)
35
+ Appsignal::CLI::Install.run(argv.shift, options)
36
36
  when :notify_of_deploy
37
37
  Appsignal::CLI::NotifyOfDeploy.run(options)
38
38
  end
@@ -85,8 +85,15 @@ module Appsignal
85
85
  o.on "--[no-]send-report", "Confirm sending the report to AppSignal automatically" do |arg|
86
86
  options[:send_report] = arg
87
87
  end
88
+ o.on "--[no-]color", "Colorize the output of the diagnose command" do |arg|
89
+ options[:color] = arg
90
+ end
91
+ end,
92
+ "install" => OptionParser.new do |o|
93
+ o.on "--[no-]color", "Colorize the output of the diagnose command" do |arg|
94
+ options[:color] = arg
95
+ end
88
96
  end,
89
- "install" => OptionParser.new,
90
97
  "notify_of_deploy" => OptionParser.new do |o|
91
98
  o.banner = "Usage: appsignal notify_of_deploy [options]"
92
99
 
@@ -77,6 +77,7 @@ module Appsignal
77
77
  # @return [void]
78
78
  # @api private
79
79
  def run(options = {})
80
+ self.coloring = options.delete(:color) { true }
80
81
  $stdout.sync = true
81
82
  header
82
83
  print_empty_line
@@ -200,7 +201,7 @@ module Appsignal
200
201
  def run_agent_diagnose_mode
201
202
  puts "Agent diagnostics"
202
203
  unless Appsignal.extension_loaded?
203
- puts " Extension is not loaded. No agent report created."
204
+ puts colorize(" Extension is not loaded. No agent report created.", :red)
204
205
  return
205
206
  end
206
207
 
@@ -461,10 +462,11 @@ module Appsignal
461
462
  print " Environment: #{format_config_option(env)}"
462
463
 
463
464
  if env == ""
464
- puts "\n Warning: No environment set, no config loaded!"
465
- puts " Please make sure appsignal diagnose is run within your "
466
- puts " project directory with an environment."
467
- puts " appsignal diagnose --environment=production"
465
+ message = " Warning: No environment set, no config loaded!\n" \
466
+ " Please make sure appsignal diagnose is run within your\n" \
467
+ " project directory with an environment.\n" \
468
+ " appsignal diagnose --environment=production"
469
+ puts "\n#{colorize(message, :red)}"
468
470
  else
469
471
  puts sources_label
470
472
  end
@@ -531,20 +533,19 @@ module Appsignal
531
533
 
532
534
  def check_api_key
533
535
  puts "Validation"
534
- data_section :validation do
535
- auth_check = ::Appsignal::AuthCheck.new(Appsignal.config)
536
- status, error = auth_check.perform_with_result
537
- result =
538
- case status
539
- when "200"
540
- "valid"
541
- when "401"
542
- "invalid"
543
- else
544
- "Failed with status #{status}\n#{error.inspect}"
545
- end
546
- puts_and_save :push_api_key, "Validating Push API key", result
547
- end
536
+ auth_check = ::Appsignal::AuthCheck.new(Appsignal.config)
537
+ status, error = auth_check.perform_with_result
538
+ result, color =
539
+ case status
540
+ when "200"
541
+ ["valid", :green]
542
+ when "401"
543
+ ["invalid", :red]
544
+ else
545
+ ["Failed with status #{status}\n#{error.inspect}", :red]
546
+ end
547
+ data[:validation][:push_api_key] = result
548
+ puts_value "Validating Push API key", colorize(result, color)
548
549
  end
549
550
 
550
551
  def print_paths_section(report)
@@ -7,24 +7,36 @@ module Appsignal
7
7
  module Helpers
8
8
  private
9
9
 
10
+ COLOR_CODES = {
11
+ :red => 31,
12
+ :green => 32,
13
+ :yellow => 33,
14
+ :blue => 34,
15
+ :pink => 35,
16
+ :default => 0
17
+ }.freeze
18
+
10
19
  def ruby_2_6_or_up?
11
20
  Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6.0")
12
21
  end
13
22
 
23
+ def coloring=(value)
24
+ @coloring = value
25
+ end
26
+
27
+ def coloring?
28
+ return true unless defined?(@coloring)
29
+ @coloring
30
+ end
31
+
14
32
  def colorize(text, color)
33
+ return text unless coloring?
15
34
  return text if Gem.win_platform?
16
35
 
17
- color_code =
18
- case color
19
- when :red then 31
20
- when :green then 32
21
- when :yellow then 33
22
- when :blue then 34
23
- when :pink then 35
24
- else 0
25
- end
36
+ reset_color_code = COLOR_CODES.fetch(:default)
37
+ color_code = COLOR_CODES.fetch(color, reset_color_code)
26
38
 
27
- "\e[#{color_code}m#{text}\e[0m"
39
+ "\e[#{color_code}m#{text}\e[#{reset_color_code}m"
28
40
  end
29
41
 
30
42
  def periods
@@ -13,7 +13,8 @@ module Appsignal
13
13
  EXCLUDED_ENVIRONMENTS = ["test"].freeze
14
14
 
15
15
  class << self
16
- def run(push_api_key)
16
+ def run(push_api_key, options) # rubocop:disable Metrics/AbcSize
17
+ self.coloring = options.delete(:color) { true }
17
18
  $stdout.sync = true
18
19
 
19
20
  puts
@@ -39,7 +39,8 @@ module Appsignal
39
39
  :enable_minutely_probes => true,
40
40
  :ca_file_path => File.expand_path(File.join("../../../resources/cacert.pem"), __FILE__),
41
41
  :dns_servers => [],
42
- :files_world_accessible => true
42
+ :files_world_accessible => true,
43
+ :transaction_debug_mode => false
43
44
  }.freeze
44
45
 
45
46
  ENV_TO_KEY_MAPPING = {
@@ -75,6 +76,7 @@ module Appsignal
75
76
  "APPSIGNAL_DNS_SERVERS" => :dns_servers,
76
77
  "APPSIGNAL_FILES_WORLD_ACCESSIBLE" => :files_world_accessible,
77
78
  "APPSIGNAL_REQUEST_HEADERS" => :request_headers,
79
+ "APPSIGNAL_TRANSACTION_DEBUG_MODE" => :transaction_debug_mode,
78
80
  "APP_REVISION" => :revision
79
81
  }.freeze
80
82
 
@@ -219,6 +221,7 @@ module Appsignal
219
221
  ENV["_APPSIGNAL_CA_FILE_PATH"] = config_hash[:ca_file_path].to_s
220
222
  ENV["_APPSIGNAL_DNS_SERVERS"] = config_hash[:dns_servers].join(",")
221
223
  ENV["_APPSIGNAL_FILES_WORLD_ACCESSIBLE"] = config_hash[:files_world_accessible].to_s
224
+ ENV["_APPSIGNAL_TRANSACTION_DEBUG_MODE"] = config_hash[:transaction_debug_mode].to_s
222
225
  ENV["_APP_REVISION"] = config_hash[:revision].to_s
223
226
  end
224
227
 
@@ -234,11 +237,12 @@ module Appsignal
234
237
  "#{endpoint_uri.scheme}://#{endpoint_uri.host}:#{endpoint_uri.port}"
235
238
  end
236
239
 
237
- if config_hash[:push_api_key]
238
- @valid = true
239
- else
240
+ push_api_key = config_hash[:push_api_key] || ""
241
+ if push_api_key.strip.empty?
240
242
  @valid = false
241
- @logger.error "Push api key not set after loading config"
243
+ @logger.error "Push API key not set after loading config"
244
+ else
245
+ @valid = true
242
246
  end
243
247
  end
244
248
 
@@ -253,8 +257,10 @@ module Appsignal
253
257
  {}.tap do |hash|
254
258
  hash[:log] = "stdout" if Appsignal::System.heroku?
255
259
 
256
- # Make active by default if APPSIGNAL_PUSH_API_KEY is present
257
- hash[:active] = true if ENV["APPSIGNAL_PUSH_API_KEY"]
260
+ # Make AppSignal active by default if APPSIGNAL_PUSH_API_KEY
261
+ # environment variable is present and not empty.
262
+ env_push_api_key = ENV["APPSIGNAL_PUSH_API_KEY"] || ""
263
+ hash[:active] = true unless env_push_api_key.strip.empty?
258
264
  end
259
265
  end
260
266
 
@@ -271,9 +277,17 @@ module Appsignal
271
277
 
272
278
  maintain_backwards_compatibility(config_for_this_env)
273
279
  else
274
- @logger.error "Not loading from config file: config for '#{env}' not found"
280
+ logger.error "Not loading from config file: config for '#{env}' not found"
275
281
  nil
276
282
  end
283
+ rescue => e
284
+ message = "An error occured while loading the AppSignal config file." \
285
+ " Skipping file config.\n" \
286
+ "File: #{config_file.inspect}\n" \
287
+ "#{e.name}: #{e}"
288
+ $stderr.puts "appsignal: #{message}"
289
+ logger.error "#{message}\n#{e.backtrace.join("\n")}"
290
+ nil
277
291
  end
278
292
 
279
293
  # Maintain backwards compatibility with config files generated by earlier
@@ -324,7 +338,7 @@ module Appsignal
324
338
  APPSIGNAL_ENABLE_ALLOCATION_TRACKING APPSIGNAL_ENABLE_GC_INSTRUMENTATION
325
339
  APPSIGNAL_RUNNING_IN_CONTAINER APPSIGNAL_ENABLE_HOST_METRICS
326
340
  APPSIGNAL_SEND_PARAMS APPSIGNAL_ENABLE_MINUTELY_PROBES
327
- APPSIGNAL_FILES_WORLD_ACCESSIBLE].each do |var|
341
+ APPSIGNAL_FILES_WORLD_ACCESSIBLE APPSIGNAL_TRANSACTION_DEBUG_MODE].each do |var|
328
342
  env_var = ENV[var]
329
343
  next unless env_var
330
344
  config[ENV_TO_KEY_MAPPING[var]] = env_var.casecmp("true").zero?
@@ -17,15 +17,15 @@ module Appsignal
17
17
  include Appsignal::Utils::DeprecationMessage
18
18
 
19
19
  def formatters
20
- @@formatters ||= {}
20
+ @formatters ||= {}
21
21
  end
22
22
 
23
23
  def deprecated_formatter_classes
24
- @@deprecated_formatter_classes ||= {}
24
+ @deprecated_formatter_classes ||= {}
25
25
  end
26
26
 
27
27
  def formatter_classes
28
- @@formatter_classes ||= {}
28
+ @formatter_classes ||= {}
29
29
  end
30
30
 
31
31
  def register(name, formatter = nil)
@@ -94,7 +94,7 @@ module Appsignal
94
94
  "https://docs.appsignal.com/ruby/instrumentation/event-formatters.html",
95
95
  logger
96
96
 
97
- deprecated_formatter_classes[name] = self
97
+ EventFormatter.deprecated_formatter_classes[name] = self
98
98
  end
99
99
 
100
100
  def logger
@@ -129,13 +129,13 @@ module Appsignal
129
129
  # @see ProbeCollection
130
130
  # @return [ProbeCollection] Returns list of probes.
131
131
  def probes
132
- @@probes ||= ProbeCollection.new
132
+ @probes ||= ProbeCollection.new
133
133
  end
134
134
 
135
135
  # @api private
136
136
  def start
137
137
  stop
138
- @@thread = Thread.new do
138
+ @thread = Thread.new do
139
139
  sleep initial_wait_time
140
140
  initialize_probes
141
141
  loop do
@@ -157,7 +157,7 @@ module Appsignal
157
157
 
158
158
  # @api private
159
159
  def stop
160
- defined?(@@thread) && @@thread.kill
160
+ defined?(@thread) && @thread.kill
161
161
  probe_instances.clear
162
162
  end
163
163
 
@@ -206,7 +206,7 @@ module Appsignal
206
206
  end
207
207
 
208
208
  def probe_instances
209
- @@probe_instances ||= {}
209
+ @probe_instances ||= {}
210
210
  end
211
211
  end
212
212
  end