appsignal 3.9.2-java → 3.10.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +3138 -0
  3. data/.rubocop.yml +28 -20
  4. data/.rubocop_todo.yml +7 -33
  5. data/CHANGELOG.md +130 -0
  6. data/README.md +0 -1
  7. data/Rakefile +80 -65
  8. data/appsignal.gemspec +1 -1
  9. data/build_matrix.yml +112 -184
  10. data/ext/base.rb +1 -1
  11. data/gemfiles/hanami-2.1.gemfile +7 -0
  12. data/gemfiles/webmachine1.gemfile +5 -4
  13. data/lib/appsignal/cli/diagnose.rb +1 -1
  14. data/lib/appsignal/config.rb +5 -1
  15. data/lib/appsignal/demo.rb +0 -1
  16. data/lib/appsignal/environment.rb +11 -2
  17. data/lib/appsignal/extension/jruby.rb +1 -1
  18. data/lib/appsignal/helpers/instrumentation.rb +164 -2
  19. data/lib/appsignal/hooks/active_job.rb +1 -6
  20. data/lib/appsignal/integrations/grape.rb +19 -47
  21. data/lib/appsignal/integrations/hanami.rb +8 -7
  22. data/lib/appsignal/integrations/padrino.rb +51 -52
  23. data/lib/appsignal/integrations/railtie.rb +0 -3
  24. data/lib/appsignal/integrations/rake.rb +46 -12
  25. data/lib/appsignal/integrations/sidekiq.rb +1 -11
  26. data/lib/appsignal/integrations/sinatra.rb +0 -1
  27. data/lib/appsignal/integrations/webmachine.rb +15 -9
  28. data/lib/appsignal/probes/gvl.rb +24 -2
  29. data/lib/appsignal/probes/sidekiq.rb +1 -1
  30. data/lib/appsignal/probes.rb +1 -1
  31. data/lib/appsignal/rack/abstract_middleware.rb +104 -33
  32. data/lib/appsignal/rack/body_wrapper.rb +143 -0
  33. data/lib/appsignal/rack/event_handler.rb +12 -3
  34. data/lib/appsignal/rack/generic_instrumentation.rb +5 -4
  35. data/lib/appsignal/rack/grape_middleware.rb +40 -0
  36. data/lib/appsignal/rack/hanami_middleware.rb +2 -12
  37. data/lib/appsignal/rack/instrumentation_middleware.rb +62 -0
  38. data/lib/appsignal/rack/rails_instrumentation.rb +14 -57
  39. data/lib/appsignal/rack/sinatra_instrumentation.rb +1 -3
  40. data/lib/appsignal/rack/streaming_listener.rb +13 -59
  41. data/lib/appsignal/rack.rb +31 -0
  42. data/lib/appsignal/transaction.rb +50 -8
  43. data/lib/appsignal/utils/integration_memory_logger.rb +78 -0
  44. data/lib/appsignal/utils.rb +1 -0
  45. data/lib/appsignal/version.rb +1 -1
  46. data/lib/appsignal.rb +36 -33
  47. data/spec/.rubocop.yml +1 -1
  48. data/spec/lib/appsignal/cli/diagnose_spec.rb +1 -1
  49. data/spec/lib/appsignal/cli/install_spec.rb +3 -3
  50. data/spec/lib/appsignal/config_spec.rb +8 -5
  51. data/spec/lib/appsignal/demo_spec.rb +38 -41
  52. data/spec/lib/appsignal/hooks/action_cable_spec.rb +86 -167
  53. data/spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb +8 -20
  54. data/spec/lib/appsignal/hooks/active_support_notifications/instrument_shared_examples.rb +38 -84
  55. data/spec/lib/appsignal/hooks/active_support_notifications/start_finish_shared_examples.rb +16 -37
  56. data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +4 -4
  57. data/spec/lib/appsignal/hooks/activejob_spec.rb +111 -200
  58. data/spec/lib/appsignal/hooks/delayed_job_spec.rb +54 -91
  59. data/spec/lib/appsignal/hooks/dry_monitor_spec.rb +14 -32
  60. data/spec/lib/appsignal/hooks/excon_spec.rb +8 -12
  61. data/spec/lib/appsignal/hooks/net_http_spec.rb +7 -42
  62. data/spec/lib/appsignal/hooks/rake_spec.rb +107 -34
  63. data/spec/lib/appsignal/hooks/redis_client_spec.rb +18 -30
  64. data/spec/lib/appsignal/hooks/redis_spec.rb +10 -16
  65. data/spec/lib/appsignal/hooks/resque_spec.rb +42 -62
  66. data/spec/lib/appsignal/hooks/shoryuken_spec.rb +33 -74
  67. data/spec/lib/appsignal/integrations/hanami_spec.rb +79 -21
  68. data/spec/lib/appsignal/integrations/http_spec.rb +12 -20
  69. data/spec/lib/appsignal/integrations/net_http_spec.rb +33 -0
  70. data/spec/lib/appsignal/integrations/object_spec.rb +29 -36
  71. data/spec/lib/appsignal/integrations/padrino_spec.rb +190 -163
  72. data/spec/lib/appsignal/integrations/que_spec.rb +43 -70
  73. data/spec/lib/appsignal/integrations/railtie_spec.rb +26 -67
  74. data/spec/lib/appsignal/integrations/sidekiq_spec.rb +86 -160
  75. data/spec/lib/appsignal/integrations/sinatra_spec.rb +10 -3
  76. data/spec/lib/appsignal/integrations/webmachine_spec.rb +77 -40
  77. data/spec/lib/appsignal/probes/gvl_spec.rb +80 -3
  78. data/spec/lib/appsignal/probes_spec.rb +7 -4
  79. data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +302 -105
  80. data/spec/lib/appsignal/rack/body_wrapper_spec.rb +263 -0
  81. data/spec/lib/appsignal/rack/event_handler_spec.rb +81 -78
  82. data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +70 -27
  83. data/spec/lib/appsignal/rack/grape_middleware_spec.rb +234 -0
  84. data/spec/lib/appsignal/rack/hanami_middleware_spec.rb +2 -16
  85. data/spec/lib/appsignal/rack/instrumentation_middleware_spec.rb +38 -0
  86. data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +67 -131
  87. data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +36 -44
  88. data/spec/lib/appsignal/rack/streaming_listener_spec.rb +44 -139
  89. data/spec/lib/appsignal/transaction_spec.rb +239 -94
  90. data/spec/lib/appsignal/utils/integration_memory_logger_spec.rb +163 -0
  91. data/spec/lib/appsignal_spec.rb +556 -344
  92. data/spec/support/helpers/dependency_helper.rb +6 -1
  93. data/spec/support/helpers/std_streams_helper.rb +1 -1
  94. data/spec/support/helpers/transaction_helpers.rb +8 -0
  95. data/spec/support/matchers/transaction.rb +185 -0
  96. data/spec/support/mocks/dummy_app.rb +20 -0
  97. data/spec/support/shared_examples/instrument.rb +17 -12
  98. data/spec/support/testing.rb +18 -9
  99. metadata +20 -11
  100. data/.semaphore/semaphore.yml +0 -2347
  101. data/script/lint_git +0 -22
  102. data/spec/lib/appsignal/integrations/grape_spec.rb +0 -239
  103. data/spec/support/matchers/be_completed.rb +0 -5
  104. data/support/check_versions +0 -22
  105. /data/gemfiles/{hanami.gemfile → hanami-2.0.gemfile} +0 -0
data/build_matrix.yml CHANGED
@@ -1,158 +1,79 @@
1
- semaphore: # Default `.semaphore/semaphore.yml` contents
2
- version: v1.0
3
- name: AppSignal Ruby Build and Tests
1
+ github:
2
+ name: Ruby gem CI
3
+ "on":
4
+ push:
5
+ branches: ["main", "develop"]
6
+ pull_request:
7
+ types: [opened, reopened, synchronize]
8
+ schedule:
9
+ - cron: "0 0 * * 1-5"
4
10
 
5
- agent:
6
- machine:
7
- type: e1-standard-2
8
- os_image: ubuntu2004
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: ${{ !contains(github.ref, 'main')}}
9
14
 
10
- # Cancel all running and queued workflows before this one
11
- auto_cancel:
12
- running:
13
- # Ignore main AND develop branch as we want it to build all workflows
14
- when: "branch != 'main' AND branch != 'develop'"
15
+ jobs:
16
+ lint-git:
17
+ name: "Git linter (Lintje)"
18
+ runs-on: ubuntu-latest
19
+ if: ${{ github.event_name != 'schedule' }}
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0 # Fetch depth is required
24
+ - name: "Run Git linter"
25
+ uses: lintje/action@v0.11
15
26
 
16
- global_job_config:
17
- env_vars:
18
- - name: RUNNING_IN_CI
19
- value: "true"
20
- - name: _BUNDLER_CACHE
21
- value: "v3"
22
- - name: _GEMS_CACHE
23
- value: "v3"
24
- prologue:
25
- commands:
26
- - checkout
27
- - rm -f $HOME/.rbenv/plugins/rbenv-gem-rehash/etc/rbenv.d/exec/~gem-rehash.bash
28
- - |
29
- if [ -n "$RUBY_VERSION" ]; then
30
- if ! (sem-version ruby "$RUBY_VERSION"); then
31
- ruby_key="rbenv-ruby-$RUBY_VERSION"
32
- echo "Attempting to build Ruby $RUBY_VERSION from source"
33
- git -C "$HOME/.rbenv/plugins/ruby-build" pull
34
- cache restore "$ruby_key"
35
- sem-version ruby "$RUBY_VERSION"
36
- if ! cache has_key "$ruby_key"; then
37
- cache store "$ruby_key" "$HOME/.rbenv/versions/$RUBY_VERSION"
38
- fi
39
- fi
40
- ./support/check_versions
41
- else
42
- echo Skipping Ruby install
43
- fi
27
+ lint-style:
28
+ name: "Ruby style linter (RuboCop)"
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: "3.3"
35
+ bundler-cache: true
36
+ - name: "Run RuboCop"
37
+ run: bundle exec rubocop
44
38
 
45
- blocks:
46
- - name: Validation
47
- dependencies: []
48
- task:
49
- prologue:
50
- commands:
51
- - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec)
52
- - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec)
53
- - ./support/bundler_wrapper install --jobs=3 --retry=3
54
- jobs:
55
- - name: Validate CI setup
56
- env_vars:
57
- - name: RUBY_VERSION
58
- value: 3.2.2
59
- - name: GEMSET
60
- value: no_dependencies
61
- - name: BUNDLE_GEMFILE
62
- value: Gemfile
63
- commands:
64
- - ./support/bundler_wrapper exec rake build_matrix:semaphore:validate
65
- epilogue:
66
- on_pass:
67
- commands:
68
- - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) .bundle
69
- - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) $HOME/.gem
70
- - name: Ruby linters
71
- dependencies: []
72
- task:
73
- prologue:
74
- commands:
75
- - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec)
76
- - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec)
77
- - ./support/bundler_wrapper install --jobs=3 --retry=3
78
- jobs:
79
- - name: RuboCop
80
- env_vars:
81
- - name: RUBY_VERSION
82
- value: 3.2.2
83
- - name: GEMSET
84
- value: no_dependencies
85
- - name: BUNDLE_GEMFILE
86
- value: Gemfile
87
- commands:
88
- - ./support/bundler_wrapper exec rubocop
89
- epilogue:
90
- on_pass:
91
- commands:
92
- - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) .bundle
93
- - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) $HOME/.gem
94
- - name: Other linters
95
- dependencies: []
96
- task:
97
- jobs:
98
- - name: Git Lint (Lintje)
99
- commands:
100
- - script/lint_git
101
- - name: Integration tests
102
- dependencies:
103
- - Validation
104
- task:
105
- prologue:
106
- commands:
107
- - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-diagnose-$(checksum Gemfile)
108
- - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-diagnose-$(checksum Gemfile)
109
- - ./support/bundler_wrapper install --jobs=3 --retry=3
110
- - ./support/bundler_wrapper exec rake extension:install
111
- - "[ -e ext/install.report ] && cat ext/install.report || echo 'No ext/install.report file found'"
112
- - "[ -f ext/mkmf.log ] && cat ext/mkmf.log || echo 'No ext/mkmf.log file found'"
113
- - git submodule init
114
- - git submodule update
115
- jobs:
116
- - name: Diagnose
117
- env_vars:
118
- - name: RUBY_VERSION
119
- value: 3.0.2
120
- - name: LANGUAGE
121
- value: ruby
122
- commands:
123
- - spec/integration/diagnose/bin/test
124
- epilogue:
125
- on_pass:
126
- commands:
127
- - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-diagnose-$(checksum Gemfile) .bundle
128
- - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-diagnose-$(checksum Gemfile) $HOME/.gem
39
+ validation:
40
+ name: "Validation of CI"
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ - uses: ruby/setup-ruby@v1
45
+ with:
46
+ ruby-version: "3.3"
47
+ bundler-cache: true
48
+ - run: rake build_matrix:github:validate
129
49
 
130
- matrix:
131
- env_vars: # Shared for all jobs in the build matrix
132
- - name: BUNDLE_PATH
133
- value: "../.bundle/"
134
- - name: RAILS_ENV
135
- value: "test"
136
- - name: JRUBY_OPTS
137
- value: ""
138
- - name: COV
139
- value: "1"
140
- prologue: # Shared for all jobs in the build matrix
141
- commands:
142
- - cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec)
143
- - cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec)
144
- - ./support/install_deps
145
- - bundle config set clean 'true'
146
- - ./support/bundler_wrapper install --jobs=3 --retry=3
147
- epilogue: # Shared for all jobs in the build matrix
148
- on_pass:
149
- commands:
150
- - cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) .bundle
151
- - cache store $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE)-$(checksum appsignal.gemspec) $HOME/.gem
50
+ integration_tests:
51
+ name: "Diagnose integration tests"
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ with:
56
+ submodules: true
57
+ - uses: ruby/setup-ruby@v1
58
+ with:
59
+ ruby-version: "3.3"
60
+ bundler-cache: true
61
+ - name: "Install gem extension"
62
+ run: rake extension:install
63
+ - name: "Bundle install"
64
+ run: bundle install
65
+ working-directory: "spec/integration/diagnose"
66
+ - name: "Run diagnose integration tests"
67
+ run: bundle exec rspec
68
+ working-directory: "spec/integration/diagnose"
69
+ env:
70
+ LANGUAGE: ruby
152
71
 
153
- defaults:
154
- rubygems: "latest"
155
- bundler: "latest"
72
+ matrix:
73
+ env: # Shared for all jobs in the build matrix
74
+ RAILS_ENV: "test"
75
+ JRUBY_OPTS: ""
76
+ COV: "1"
156
77
 
157
78
  gemsets: # By default all gems are tested
158
79
  none:
@@ -165,12 +86,12 @@ matrix:
165
86
  - "rails-7.1"
166
87
 
167
88
  ruby:
168
- - ruby: "2.7.8"
169
- - ruby: "3.0.5"
170
- - ruby: "3.1.3"
171
- - ruby: "3.2.1"
172
89
  - ruby: "3.3.1"
173
- - ruby: "jruby-9.4.1.0"
90
+ - ruby: "3.2.1"
91
+ - ruby: "3.1.3"
92
+ - ruby: "3.0.5"
93
+ - ruby: "2.7.8"
94
+ - ruby: "jruby-9.4.7.0"
174
95
  gems: "minimal"
175
96
  gems:
176
97
  - gem: "no_dependencies"
@@ -179,70 +100,77 @@ matrix:
179
100
  - gem: "dry-monitor"
180
101
  only:
181
102
  ruby:
182
- - "3.0.5"
183
- - "3.1.3"
184
- - "3.2.1"
185
103
  - "3.3.1"
104
+ - "3.2.1"
105
+ - "3.1.3"
106
+ - "3.0.5"
186
107
  - gem: "grape"
187
- - gem: "hanami"
108
+ - gem: "hanami-2.0"
188
109
  only:
189
110
  ruby:
190
- - "3.0.5"
191
- - "3.1.3"
111
+ - "3.3.1"
192
112
  - "3.2.1"
113
+ - "3.1.3"
114
+ - "3.0.5"
115
+ - gem: "hanami-2.1"
116
+ only:
117
+ ruby:
193
118
  - "3.3.1"
119
+ - "3.2.1"
120
+ - "3.1.3"
121
+ - "3.0.5"
194
122
  - gem: "http5"
195
123
  - gem: "padrino"
196
124
  - gem: "psych-3"
197
125
  only:
198
126
  ruby:
199
- - "2.7.8"
200
- - "3.0.5"
201
- - "3.1.3"
202
- - "3.2.1"
203
127
  - "3.3.1"
128
+ - "3.2.1"
129
+ - "3.1.3"
130
+ - "3.0.5"
131
+ - "2.7.8"
204
132
  - gem: "psych-4"
205
133
  only:
206
134
  ruby:
207
- - "2.7.8"
208
- - "3.0.5"
209
- - "3.1.3"
210
- - "3.2.1"
211
135
  - "3.3.1"
136
+ - "3.2.1"
137
+ - "3.1.3"
138
+ - "3.0.5"
139
+ - "2.7.8"
212
140
  - gem: "que"
213
141
  - gem: "que_beta"
214
142
  - gem: "rails-6.0"
215
143
  only:
216
144
  ruby:
217
- - "2.7.8"
218
145
  - "3.0.5"
219
- - "jruby-9.4.1.0"
146
+ - "2.7.8"
147
+ - "jruby-9.4.7.0"
220
148
  - gem: "rails-6.1"
221
149
  only:
222
150
  ruby:
223
- - "2.7.8"
224
- - "3.0.5"
225
- - "3.1.3"
226
- - "3.2.1"
227
151
  - "3.3.1"
228
- - "jruby-9.4.1.0"
152
+ - "3.2.1"
153
+ - "3.1.3"
154
+ - "3.0.5"
155
+ - "2.7.8"
156
+ - "jruby-9.4.7.0"
229
157
  - gem: "rails-7.0"
230
158
  only:
231
159
  ruby:
232
- - "2.7.8"
233
- - "3.0.5"
234
- - "3.1.3"
235
- - "3.2.1"
236
160
  - "3.3.1"
237
- - "jruby-9.4.1.0"
161
+ - "3.2.1"
162
+ - "3.1.3"
163
+ - "3.0.5"
164
+ - "2.7.8"
165
+ - "jruby-9.4.7.0"
238
166
  - gem: "rails-7.1"
239
167
  only:
240
168
  ruby:
241
- - "3.0.5"
242
- - "3.1.3"
243
- - "3.2.1"
244
169
  - "3.3.1"
245
- - "jruby-9.4.1.0"
170
+ - "3.2.1"
171
+ - "3.1.3"
172
+ - "3.0.5"
173
+ - "jruby-9.4.7.0"
246
174
  - gem: "sequel"
247
175
  - gem: "sinatra"
248
176
  - gem: "webmachine1"
data/ext/base.rb CHANGED
@@ -8,7 +8,7 @@ require "json"
8
8
  require "rubygems/package"
9
9
  require File.expand_path("../lib/appsignal/version.rb", __dir__)
10
10
  require File.expand_path("../lib/appsignal/system.rb", __dir__)
11
- require_relative "./agent"
11
+ require_relative "agent"
12
12
 
13
13
  EXT_PATH = File.expand_path(__dir__).freeze
14
14
 
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "hanami", "~> 2.1.0"
4
+ gem "hanami-router", "~> 2.1.0"
5
+ gem "hanami-controller", "~> 2.1.0"
6
+
7
+ gemspec :path => '../'
@@ -1,6 +1,7 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- gem 'webmachine', '~> 1.6'
4
- gem 'webrick'
3
+ gem "i18n", "~> 0.0" # Lock to pre 1.x version as it's not compatible
4
+ gem "webmachine", "~> 1.6"
5
+ gem "webrick"
5
6
 
6
- gemspec :path => '../'
7
+ gemspec :path => "../"
@@ -200,7 +200,7 @@ module Appsignal
200
200
  initial_config
201
201
  )
202
202
  Appsignal.config.write_to_environment
203
- Appsignal.start_logger
203
+ Appsignal._start_logger
204
204
  Appsignal.internal_logger.info("Starting AppSignal diagnose")
205
205
  end
206
206
 
@@ -23,6 +23,7 @@ module Appsignal
23
23
  :enable_gvl_global_timer => true,
24
24
  :enable_gvl_waiting_threads => true,
25
25
  :enable_rails_error_reporter => true,
26
+ :enable_rake_performance_instrumentation => false,
26
27
  :endpoint => "https://push.appsignal.com",
27
28
  :files_world_accessible => true,
28
29
  :filter_metadata => [],
@@ -83,6 +84,8 @@ module Appsignal
83
84
  "APPSIGNAL_ENABLE_GVL_GLOBAL_TIMER" => :enable_gvl_global_timer,
84
85
  "APPSIGNAL_ENABLE_GVL_WAITING_THREADS" => :enable_gvl_waiting_threads,
85
86
  "APPSIGNAL_ENABLE_RAILS_ERROR_REPORTER" => :enable_rails_error_reporter,
87
+ "APPSIGNAL_ENABLE_RAKE_PERFORMANCE_INSTRUMENTATION" =>
88
+ :enable_rake_performance_instrumentation,
86
89
  "APPSIGNAL_FILES_WORLD_ACCESSIBLE" => :files_world_accessible,
87
90
  "APPSIGNAL_FILTER_METADATA" => :filter_metadata,
88
91
  "APPSIGNAL_FILTER_PARAMETERS" => :filter_parameters,
@@ -150,6 +153,7 @@ module Appsignal
150
153
  APPSIGNAL_ENABLE_GVL_GLOBAL_TIMER
151
154
  APPSIGNAL_ENABLE_GVL_WAITING_THREADS
152
155
  APPSIGNAL_ENABLE_RAILS_ERROR_REPORTER
156
+ APPSIGNAL_ENABLE_RAKE_PERFORMANCE_INSTRUMENTATION
153
157
  APPSIGNAL_FILES_WORLD_ACCESSIBLE
154
158
  APPSIGNAL_INSTRUMENT_HTTP_RB
155
159
  APPSIGNAL_INSTRUMENT_NET_HTTP
@@ -233,7 +237,7 @@ module Appsignal
233
237
  # variables config.
234
238
  # @param logger [Logger] The logger to use for the AppSignal gem. This is
235
239
  # used by the configuration class only. Default:
236
- # {Appsignal.internal_logger}. See also {Appsignal.start_logger}.
240
+ # {Appsignal.internal_logger}. See also {Appsignal.start}.
237
241
  # @param config_file [String] Custom config file location. Default
238
242
  # `config/appsignal.yml`.
239
243
  #
@@ -29,7 +29,6 @@ module Appsignal
29
29
  # - returns `false` if Appsignal is not active.
30
30
  def transmit
31
31
  Appsignal.start
32
- Appsignal.start_logger
33
32
  return false unless Appsignal.active?
34
33
 
35
34
  create_example_error_request
@@ -3,6 +3,8 @@
3
3
  module Appsignal
4
4
  # @api private
5
5
  class Environment
6
+ ERROR_ON_YIELD = :APPSIGNAL_ERROR_ON_YIELD
7
+
6
8
  # Add environment metadata.
7
9
  #
8
10
  # The key and value of the environment metadata must be a String, even if
@@ -46,9 +48,11 @@ module Appsignal
46
48
  Appsignal.internal_logger.error \
47
49
  "Unable to report on environment metadata #{key.inspect}:\n" \
48
50
  "#{e.class}: #{e}"
49
- return
51
+ ERROR_ON_YIELD
50
52
  end
51
53
 
54
+ return if yielded_value == ERROR_ON_YIELD
55
+
52
56
  value =
53
57
  case yielded_value
54
58
  when TrueClass, FalseClass
@@ -117,7 +121,12 @@ module Appsignal
117
121
  def self.report_supported_gems
118
122
  return unless defined?(Bundler) # Do nothing if Bundler is not present
119
123
 
120
- bundle_gem_specs = ::Bundler.rubygems.all_specs
124
+ bundle_gem_specs =
125
+ if ::Bundler.rubygems.respond_to?(:installed_specs)
126
+ ::Bundler.rubygems.installed_specs
127
+ else
128
+ ::Bundler.rubygems.all_specs
129
+ end
121
130
  SUPPORTED_GEMS.each do |gem_name|
122
131
  gem_spec = bundle_gem_specs.find { |spec| spec.name == gem_name }
123
132
  next unless gem_spec
@@ -9,7 +9,7 @@ module Appsignal
9
9
  # Only loaded if the system is detected as JRuby.
10
10
  #
11
11
  # @api private
12
- module Jruby # rubocop:disable Metrics/ModuleLength
12
+ module Jruby
13
13
  extend FFI::Library
14
14
 
15
15
  # JRuby extension String helpers.