appsignal 2.11.0.alpha.2 → 2.11.0.beta.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/.semaphore/semaphore.yml +94 -10
  4. data/CHANGELOG.md +31 -1
  5. data/README.md +4 -4
  6. data/Rakefile +16 -4
  7. data/appsignal.gemspec +1 -1
  8. data/build_matrix.yml +7 -3
  9. data/ext/Rakefile +2 -0
  10. data/ext/agent.yml +19 -19
  11. data/ext/base.rb +7 -0
  12. data/ext/extconf.rb +2 -0
  13. data/gemfiles/rails-4.2.gemfile +9 -2
  14. data/gemfiles/rails-5.0.gemfile +1 -0
  15. data/gemfiles/rails-5.1.gemfile +1 -0
  16. data/gemfiles/rails-5.2.gemfile +1 -0
  17. data/gemfiles/rails-6.0.gemfile +1 -0
  18. data/gemfiles/resque-1.gemfile +7 -0
  19. data/gemfiles/{resque.gemfile → resque-2.gemfile} +1 -1
  20. data/lib/appsignal.rb +1 -0
  21. data/lib/appsignal/auth_check.rb +4 -2
  22. data/lib/appsignal/cli/diagnose.rb +1 -1
  23. data/lib/appsignal/config.rb +35 -2
  24. data/lib/appsignal/extension.rb +6 -5
  25. data/lib/appsignal/extension/jruby.rb +6 -5
  26. data/lib/appsignal/hooks.rb +25 -0
  27. data/lib/appsignal/hooks/active_job.rb +137 -0
  28. data/lib/appsignal/hooks/puma.rb +0 -1
  29. data/lib/appsignal/hooks/resque.rb +60 -0
  30. data/lib/appsignal/hooks/sidekiq.rb +17 -94
  31. data/lib/appsignal/integrations/delayed_job_plugin.rb +1 -1
  32. data/lib/appsignal/integrations/que.rb +1 -1
  33. data/lib/appsignal/integrations/resque.rb +9 -12
  34. data/lib/appsignal/integrations/resque_active_job.rb +9 -32
  35. data/lib/appsignal/probes.rb +7 -0
  36. data/lib/appsignal/probes/puma.rb +1 -1
  37. data/lib/appsignal/probes/sidekiq.rb +3 -1
  38. data/lib/appsignal/transaction.rb +10 -0
  39. data/lib/appsignal/utils/deprecation_message.rb +6 -2
  40. data/lib/appsignal/version.rb +1 -1
  41. data/spec/lib/appsignal/auth_check_spec.rb +23 -0
  42. data/spec/lib/appsignal/capistrano2_spec.rb +1 -1
  43. data/spec/lib/appsignal/capistrano3_spec.rb +1 -1
  44. data/spec/lib/appsignal/cli/diagnose_spec.rb +42 -0
  45. data/spec/lib/appsignal/config_spec.rb +21 -0
  46. data/spec/lib/appsignal/extension/jruby_spec.rb +31 -28
  47. data/spec/lib/appsignal/extension_install_failure_spec.rb +23 -0
  48. data/spec/lib/appsignal/hooks/activejob_spec.rb +591 -0
  49. data/spec/lib/appsignal/hooks/delayed_job_spec.rb +3 -14
  50. data/spec/lib/appsignal/hooks/resque_spec.rb +185 -0
  51. data/spec/lib/appsignal/hooks/sidekiq_spec.rb +222 -268
  52. data/spec/lib/appsignal/hooks_spec.rb +57 -0
  53. data/spec/lib/appsignal/integrations/que_spec.rb +25 -6
  54. data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +20 -179
  55. data/spec/lib/appsignal/integrations/resque_spec.rb +20 -85
  56. data/spec/lib/appsignal/marker_spec.rb +1 -1
  57. data/spec/lib/appsignal/probes/sidekiq_spec.rb +10 -7
  58. data/spec/lib/appsignal/transaction_spec.rb +5 -7
  59. data/spec/spec_helper.rb +5 -0
  60. data/spec/support/helpers/action_mailer_helpers.rb +25 -0
  61. data/spec/support/helpers/config_helpers.rb +3 -2
  62. data/spec/support/helpers/dependency_helper.rb +9 -2
  63. data/spec/support/helpers/transaction_helpers.rb +6 -0
  64. data/spec/support/stubs/sidekiq/api.rb +1 -1
  65. data/spec/support/testing.rb +19 -19
  66. metadata +16 -4
@@ -3,8 +3,38 @@
3
3
  # 2.11.0
4
4
  - Track queue time regardless of namespace. Support custom namespaces. PR #602
5
5
  - Improve deprecation message from frontend error middleware. PR #620
6
- - Report Ruby environment metadata. PR #621, #627
6
+ - Report Ruby environment metadata. PR #621, #627, #619, #618
7
7
  - Refactor: Move minutely probes to their own files and modules. PR #623
8
+ - Allow custom action names in Que integration. Needed for Active Job
9
+ integration. PR #628
10
+ - Add Active Job support. Support Active Job without separate AppSignal
11
+ integration of the background job library. Add support for previously
12
+ unsupported Active Job adapters. Adapters that were previously already
13
+ supported (Sidekiq, DelayedJob and Resque) still work in this new setup.
14
+ PR #629
15
+ - Add automatic Resque integration. Remove manual Resque and Resque Active Job
16
+ integrations. PR #630
17
+ - Fix issue with unknown events from being reported as often for long running
18
+ agents. Commit ba9afb538f44c68b8035a8cf40a39d89bc77b021
19
+ - Add support for Active Job priority. PR #632
20
+ - Track Active Job job metrics for magic dashboard. PR #633
21
+ - Report Sidekiq `jid` (job id) as transaction id, reported as "request_id" on
22
+ AppSignal.com. PR #640
23
+ - Always report Active Job ID, an internal ID used by Active Job. PR #639
24
+ - Support Delayed::Job jobs without specific method name, using
25
+ `Delayed::Job.enqueue`. PR #642
26
+ - Print warnings using Kernel.warn. PR #648
27
+ - Update AuthCheck class to use DeprecationMessage helper. PR #649
28
+ - Print extension load error when AppSignal is loaded. PR #651
29
+
30
+ # 2.10.11
31
+ - Fix extension install report status output in `appsignal diagnose`. PR #636
32
+ - Support setting a specific configuration file to load with the
33
+ `Appsignal::Config` initializer. PR #638
34
+
35
+ # 2.10.10
36
+ - Bump agent to v-4548c88. PR #634
37
+ - Fix issue with host metrics values being reported as "Infinity".
8
38
 
9
39
  # 2.10.9
10
40
  - Use http proxy if configured when downloading agent. PR #606
data/README.md CHANGED
@@ -9,7 +9,7 @@ issues.
9
9
  - [Ruby code documentation][ruby-doc]
10
10
  - [Support][contact]
11
11
 
12
- [![Build status](https://appsignal.semaphoreci.com/badges/appsignal-ruby/branches/master.svg)](https://appsignal.semaphoreci.com/projects/appsignal-ruby)
12
+ [![Build status](https://appsignal.semaphoreci.com/badges/appsignal-ruby/branches/main.svg)](https://appsignal.semaphoreci.com/projects/appsignal-ruby)
13
13
  [![Gem Version](https://badge.fury.io/rb/appsignal.svg)](http://badge.fury.io/rb/appsignal)
14
14
  [![Code Climate](https://codeclimate.com/github/appsignal/appsignal.png)](https://codeclimate.com/github/appsignal/appsignal)
15
15
 
@@ -183,7 +183,7 @@ installing the AppSignal C-extension.
183
183
  # Gemfile
184
184
  gem "appsignal",
185
185
  :git => "https://github.com/appsignal/appsignal-ruby.git",
186
- :branch => "master"
186
+ :branch => "main"
187
187
  ```
188
188
 
189
189
  When you need to use a git source of the gem in your JRuby install, you'll need
@@ -242,12 +242,12 @@ a number of different Ruby versions.
242
242
 
243
243
  This gem uses [Semantic Versioning][semver].
244
244
 
245
- The `master` branch corresponds to the current stable release of the gem.
245
+ The `main` branch corresponds to the current stable release of the gem.
246
246
 
247
247
  The `develop` branch is used for development of features that will end up in
248
248
  the next minor release.
249
249
 
250
- Open a Pull Request on the `master` branch if you're fixing a bug. For new new
250
+ Open a Pull Request on the `main` branch if you're fixing a bug. For new new
251
251
  features, open a Pull Request on the `develop` branch.
252
252
 
253
253
  Every stable and unstable release is tagged in git with a version tag.
data/Rakefile CHANGED
@@ -70,7 +70,10 @@ namespace :build_matrix do
70
70
  job = {
71
71
  "name" => "Ruby #{ruby_version} for #{gem["gem"]}",
72
72
  "env_vars" => env,
73
- "commands" => ["./support/bundler_wrapper exec rake test"]
73
+ "commands" => [
74
+ "./support/bundler_wrapper exec rake test",
75
+ "./support/bundler_wrapper exec rake test:failure"
76
+ ]
74
77
  }
75
78
  if gem["gem"] == "no_dependencies"
76
79
  ruby_primary_block["task"]["jobs"] << job
@@ -364,11 +367,20 @@ end
364
367
 
365
368
  begin
366
369
  require "rspec/core/rake_task"
370
+ is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
371
+ unless is_jruby
372
+ jruby_opts = "--exclude-pattern=spec/lib/appsignal/extension/jruby_spec.rb"
373
+ end
374
+
367
375
  desc "Run the AppSignal gem test suite."
368
376
  RSpec::Core::RakeTask.new :test do |t|
369
- is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
370
- unless is_jruby
371
- t.rspec_opts = "--exclude-pattern=spec/lib/appsignal/extension/jruby_spec.rb"
377
+ t.rspec_opts = jruby_opts
378
+ end
379
+
380
+ namespace :test do
381
+ desc "Run the Appsignal gem test in an extension failure scenario"
382
+ RSpec::Core::RakeTask.new :failure do |t|
383
+ t.rspec_opts = "#{jruby_opts} --tag extension_installation_failure"
372
384
  end
373
385
  end
374
386
  rescue LoadError # rubocop:disable Lint/HandleExceptions
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
29
29
  gem.metadata = {
30
30
  "bug_tracker_uri" => "https://github.com/appsignal/appsignal-ruby/issues",
31
31
  "changelog_uri" =>
32
- "https://github.com/appsignal/appsignal-ruby/blob/master/CHANGELOG.md",
32
+ "https://github.com/appsignal/appsignal-ruby/blob/main/CHANGELOG.md",
33
33
  "documentation_uri" => "https://docs.appsignal.com/ruby/",
34
34
  "homepage_uri" => "https://docs.appsignal.com/ruby/",
35
35
  "source_code_uri" => "https://github.com/appsignal/appsignal-ruby"
@@ -10,8 +10,8 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
10
10
  # Cancel all running and queued workflows before this one
11
11
  auto_cancel:
12
12
  running:
13
- # Ignore master AND develop branch as we want it to build all workflows
14
- when: "branch != 'master' AND branch != 'develop'"
13
+ # Ignore main AND develop branch as we want it to build all workflows
14
+ when: "branch != 'main' AND branch != 'develop'"
15
15
 
16
16
  global_job_config:
17
17
  env_vars:
@@ -165,8 +165,12 @@ matrix:
165
165
  - "2.3.8"
166
166
  - "2.4.9"
167
167
  - "jruby-9.1.17.0"
168
- - gem: "resque"
168
+ - gem: "resque-1"
169
169
  bundler: "1.17.3"
170
+ - gem: "resque-2"
171
+ exclude:
172
+ ruby:
173
+ - "2.0.0-p648"
170
174
  - gem: "sequel"
171
175
  - gem: "sequel-435"
172
176
  - gem: "sinatra"
@@ -11,6 +11,8 @@ end
11
11
 
12
12
  task :default do
13
13
  begin
14
+ fail_install_on_purpose_in_test!
15
+
14
16
  library_type = "dynamic"
15
17
  report["language"]["implementation"] = "jruby"
16
18
  report["build"]["library_type"] = library_type
@@ -1,70 +1,70 @@
1
1
  ---
2
- version: 710d341
2
+ version: c8f8185
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: 47f53b67d5e28e23859ed7bbcc6cde7ba3c142bf0f7c32ffa0d89c628178d4cc
9
+ checksum: 8fad088047d8c73e5c0cf9213c20873ad591881d4f7059b178d8eeb89255f73e
10
10
  filename: appsignal-x86_64-darwin-all-static.tar.gz
11
11
  dynamic:
12
- checksum: 0b2b1533cf5c6f400fbe367fd6a3200c60ecfe6cd8b44a6707bc2a57ef78fe4d
12
+ checksum: 9a26f0dc170d38b068f66aaa016772f9e32e5fea99dc57bb9dfbc5f0a41dec89
13
13
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
14
14
  universal-darwin:
15
15
  static:
16
- checksum: 47f53b67d5e28e23859ed7bbcc6cde7ba3c142bf0f7c32ffa0d89c628178d4cc
16
+ checksum: 8fad088047d8c73e5c0cf9213c20873ad591881d4f7059b178d8eeb89255f73e
17
17
  filename: appsignal-x86_64-darwin-all-static.tar.gz
18
18
  dynamic:
19
- checksum: 0b2b1533cf5c6f400fbe367fd6a3200c60ecfe6cd8b44a6707bc2a57ef78fe4d
19
+ checksum: 9a26f0dc170d38b068f66aaa016772f9e32e5fea99dc57bb9dfbc5f0a41dec89
20
20
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
21
21
  i686-linux:
22
22
  static:
23
- checksum: d815dd40495175a83d1bed0facfb97a472a74bdfe7aafbe6f72192e66b45a559
23
+ checksum: 0e8c4436684824a325fa1b581f6fad88598c529307b2b5ad0cc2620d22d2782f
24
24
  filename: appsignal-i686-linux-all-static.tar.gz
25
25
  dynamic:
26
- checksum: 2e785cf04d500eaad577c3391d236c38d850fed9b541a0e79803ee9bf66852aa
26
+ checksum: d0fc35643b36b368a985961ea1c68c3204927f9fed412fde64d81b04081651ff
27
27
  filename: appsignal-i686-linux-all-dynamic.tar.gz
28
28
  x86-linux:
29
29
  static:
30
- checksum: d815dd40495175a83d1bed0facfb97a472a74bdfe7aafbe6f72192e66b45a559
30
+ checksum: 0e8c4436684824a325fa1b581f6fad88598c529307b2b5ad0cc2620d22d2782f
31
31
  filename: appsignal-i686-linux-all-static.tar.gz
32
32
  dynamic:
33
- checksum: 2e785cf04d500eaad577c3391d236c38d850fed9b541a0e79803ee9bf66852aa
33
+ checksum: d0fc35643b36b368a985961ea1c68c3204927f9fed412fde64d81b04081651ff
34
34
  filename: appsignal-i686-linux-all-dynamic.tar.gz
35
35
  i686-linux-musl:
36
36
  static:
37
- checksum: 4c66f26fb7925445ba0bb353cbf753f00572ffdae16a28220f6306bcb34a686b
37
+ checksum: 28b69e895da6b2a30402eed29cf8c3bbc4f647d6ce9cc5e0b11b4a771d7a1021
38
38
  filename: appsignal-i686-linux-musl-all-static.tar.gz
39
39
  x86-linux-musl:
40
40
  static:
41
- checksum: 4c66f26fb7925445ba0bb353cbf753f00572ffdae16a28220f6306bcb34a686b
41
+ checksum: 28b69e895da6b2a30402eed29cf8c3bbc4f647d6ce9cc5e0b11b4a771d7a1021
42
42
  filename: appsignal-i686-linux-musl-all-static.tar.gz
43
43
  x86_64-linux:
44
44
  static:
45
- checksum: d59929c9b2075eb93f0b66a8f9ea4d7d90a897b996a4ff054fd68610282ed616
45
+ checksum: fb457dc39e005bb8f241e1e260bb9ea0460cf922db5e30f514dda8afa0bd57bc
46
46
  filename: appsignal-x86_64-linux-all-static.tar.gz
47
47
  dynamic:
48
- checksum: b1d22b323fdf9d8dbce17194ae42d3f7ddb252342db70428aea1c6baab5e6959
48
+ checksum: 55b26406ab0309905d5ad3aa34d1910fcc473f2a475ed5b3073d160a7ea68852
49
49
  filename: appsignal-x86_64-linux-all-dynamic.tar.gz
50
50
  x86_64-linux-musl:
51
51
  static:
52
- checksum: 7b8cd90260f6bc31ed2aa61dac8889a79a8c5b35f453b2f9d47d1e74133d2c2f
52
+ checksum: cf469d6e3ee1dc6ccb9762a996355ecc407b9a906b9c0a0b6742363347ec9494
53
53
  filename: appsignal-x86_64-linux-musl-all-static.tar.gz
54
54
  dynamic:
55
- checksum: 8922f1e3a845ea869a1553aeb87681346c709dbab96636f703dfc3bc855621d8
55
+ checksum: '0938eab03f2b00583a9b730743c68d3d350090a0ff96866b960a9c78a486a992'
56
56
  filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
57
57
  x86_64-freebsd:
58
58
  static:
59
- checksum: bb15ae46b7df4f2851982bcd8b079cd6b5ea384c19eaed9f20cdf152e435c4ea
59
+ checksum: 5c50e4776dbd0defe7d99015650e85d7983222ea27bd7b586b4c92f7b8336eee
60
60
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
61
61
  dynamic:
62
- checksum: 0be60faf18df3eddedd5d85e34fdbcccb3ce6aae52ef6faeebe881c3e0fe2022
62
+ checksum: 02cd3b26317100290a2cfac014db026a2607723127955da1e4ddd5b76591003a
63
63
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
64
64
  amd64-freebsd:
65
65
  static:
66
- checksum: bb15ae46b7df4f2851982bcd8b079cd6b5ea384c19eaed9f20cdf152e435c4ea
66
+ checksum: 5c50e4776dbd0defe7d99015650e85d7983222ea27bd7b586b4c92f7b8336eee
67
67
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
68
68
  dynamic:
69
- checksum: 0be60faf18df3eddedd5d85e34fdbcccb3ce6aae52ef6faeebe881c3e0fe2022
69
+ checksum: 02cd3b26317100290a2cfac014db026a2607723127955da1e4ddd5b76591003a
70
70
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
@@ -183,3 +183,10 @@ end
183
183
  def http_proxy
184
184
  Gem.configuration[:http_proxy] || ENV["http_proxy"] || ENV["HTTP_PROXY"]
185
185
  end
186
+
187
+ # Fail the installation on purpose in a specific test environment.
188
+ def fail_install_on_purpose_in_test!
189
+ return unless ENV["_TEST_APPSIGNAL_EXTENSION_FAILURE"]
190
+
191
+ raise "AppSignal internal test failure"
192
+ end
@@ -7,6 +7,8 @@ def local_build?
7
7
  end
8
8
 
9
9
  def install
10
+ fail_install_on_purpose_in_test!
11
+
10
12
  library_type = "static"
11
13
  report["language"]["implementation"] = "ruby"
12
14
  report["build"]["library_type"] = library_type
@@ -3,8 +3,15 @@ source 'https://rubygems.org'
3
3
  gem 'rails', '~> 4.2.0'
4
4
  gem 'mime-types', '~> 2.6'
5
5
 
6
- gemspec :path => '../'
6
+ ruby_version = Gem::Version.new(RUBY_VERSION)
7
+ if ruby_version < Gem::Version.new("2.3.0")
8
+ gem "sidekiq", "~> 4.0"
9
+ else
10
+ gem "sidekiq"
11
+ end
7
12
 
8
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1.0")
13
+ if ruby_version < Gem::Version.new("2.1.0")
9
14
  gem 'nokogiri', '~> 1.6.0'
10
15
  end
16
+
17
+ gemspec :path => '../'
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.0.0'
4
+ gem "sidekiq"
4
5
 
5
6
  gemspec :path => '../'
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.1.0'
4
+ gem "sidekiq"
4
5
 
5
6
  gemspec :path => '../'
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.2.0'
4
+ gem "sidekiq"
4
5
 
5
6
  gemspec :path => '../'
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 6.0.0'
4
+ gem "sidekiq"
4
5
 
5
6
  gemspec :path => '../'
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'resque', "~> 1.27.0"
4
+ gem 'sinatra'
5
+ gem 'mime-types', '~> 2.6'
6
+
7
+ gemspec :path => '../'
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'resque'
3
+ gem 'resque', "~> 2.0"
4
4
  gem 'sinatra'
5
5
  gem 'mime-types', '~> 2.6'
6
6
 
@@ -339,6 +339,7 @@ require "appsignal/auth_check"
339
339
  require "appsignal/config"
340
340
  require "appsignal/event_formatter"
341
341
  require "appsignal/hooks"
342
+ require "appsignal/probes"
342
343
  require "appsignal/marker"
343
344
  require "appsignal/minutely"
344
345
  require "appsignal/garbage_collection_profiler"
@@ -25,8 +25,10 @@ module Appsignal
25
25
  def initialize(config, logger = nil)
26
26
  @config = config
27
27
  if logger # rubocop:disable Style/GuardClause
28
- warn "Deprecated: `logger` argument will be removed in the next " \
29
- "major version."
28
+ Appsignal::Utils::DeprecationMessage.message \
29
+ "`Appsignal::AuthCheck.new`'s `logger` argument will be removed " \
30
+ "in the next major version. Please configure the logger " \
31
+ "using `Appsignal.logger`."
30
32
  end
31
33
  end
32
34
 
@@ -371,7 +371,7 @@ module Appsignal
371
371
  end
372
372
 
373
373
  def print_installation_result_report(report)
374
- report = report.fetch("download", {})
374
+ report = report.fetch("result", {})
375
375
  puts " Installation result"
376
376
  puts " Status: #{report["status"]}"
377
377
  puts " Message: #{report["message"]}" if report["message"]
@@ -121,8 +121,41 @@ module Appsignal
121
121
  :initial_config, :file_config, :env_config
122
122
  attr_accessor :logger
123
123
 
124
- def initialize(root_path, env, initial_config = {}, logger = Appsignal.logger)
124
+ # Initialize a new configuration object for AppSignal.
125
+ #
126
+ # If this is manually initialized, and not by {Appsignal.start}, it needs
127
+ # to be assigned to the {Appsignal.config} attribute.
128
+ #
129
+ # @example
130
+ # require "appsignal"
131
+ # Appsignal.config = Appsignal::Config.new(
132
+ # app_path,
133
+ # "production"
134
+ # )
135
+ # Appsignal.start
136
+ #
137
+ # @param root_path [String] Root path of the app.
138
+ # @param env [String] The environment to load when AppSignal is started. It
139
+ # will look for an environment with this name in the `config/appsignal.yml`
140
+ # config file.
141
+ # @param initial_config [Hash<String, Object>] The initial configuration to
142
+ # use. This will be overwritten by the file config and environment
143
+ # variables config.
144
+ # @param logger [Logger] The logger to use for the AppSignal gem. This is
145
+ # used by the configuration class only. Default: {Appsignal.logger}. See
146
+ # also {Appsignal.start_logger}.
147
+ # @param config_file [String] Custom config file location. Default
148
+ # `config/appsignal.yml`.
149
+ #
150
+ # @see https://docs.appsignal.com/ruby/configuration/
151
+ # Configuration documentation
152
+ # @see https://docs.appsignal.com/ruby/configuration/load-order.html
153
+ # Configuration load order
154
+ # @see https://docs.appsignal.com/ruby/instrumentation/integrating-appsignal.html
155
+ # How to integrate AppSignal manually
156
+ def initialize(root_path, env, initial_config = {}, logger = Appsignal.logger, config_file = nil)
125
157
  @root_path = root_path
158
+ @config_file = config_file
126
159
  @logger = logger
127
160
  @valid = false
128
161
  @config_hash = Hash[DEFAULT_CONFIG]
@@ -288,7 +321,7 @@ module Appsignal
288
321
  " Skipping file config.\n" \
289
322
  "File: #{config_file.inspect}\n" \
290
323
  "#{e.class.name}: #{e}"
291
- $stderr.puts "appsignal: #{message}"
324
+ Kernel.warn "appsignal: #{message}"
292
325
  logger.error "#{message}\n#{e.backtrace.join("\n")}"
293
326
  nil
294
327
  end
@@ -10,11 +10,12 @@ begin
10
10
  require "appsignal_extension"
11
11
  Appsignal.extension_loaded = true
12
12
  end
13
- rescue LoadError => err
14
- Appsignal.logger.error(
15
- "Failed to load extension (#{err}), please run `appsignal diagnose` " \
16
- "and email us at support@appsignal.com"
17
- )
13
+ rescue LoadError => error
14
+ error_message = "ERROR: AppSignal failed to load extension. " \
15
+ "Please run `appsignal diagnose` and email us at support@appsignal.com\n" \
16
+ "#{error.class}: #{error.message}"
17
+ Appsignal.logger.error(error_message)
18
+ Kernel.warn error_message
18
19
  Appsignal.extension_loaded = false
19
20
  end
20
21
 
@@ -179,11 +179,12 @@ module Appsignal
179
179
  :appsignal_string
180
180
 
181
181
  Appsignal.extension_loaded = true
182
- rescue LoadError => err
183
- Appsignal.logger.error(
184
- "Failed to load extension (#{err}), please email us at " \
185
- "support@appsignal.com"
186
- )
182
+ rescue LoadError => error
183
+ error_message = "ERROR: AppSignal failed to load extension. " \
184
+ "Please run `appsignal diagnose` and email us at support@appsignal.com\n" \
185
+ "#{error.class}: #{error.message}"
186
+ Appsignal.logger.error(error_message)
187
+ Kernel.warn error_message
187
188
  Appsignal.extension_loaded = false
188
189
  end
189
190