appsignal 3.9.3-java → 3.11.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +22 -19
  3. data/.rubocop.yml +1 -1
  4. data/CHANGELOG.md +180 -0
  5. data/Gemfile +1 -0
  6. data/README.md +0 -1
  7. data/Rakefile +1 -1
  8. data/benchmark.rake +99 -42
  9. data/build_matrix.yml +10 -12
  10. data/gemfiles/webmachine1.gemfile +5 -4
  11. data/lib/appsignal/cli/demo.rb +0 -1
  12. data/lib/appsignal/config.rb +57 -97
  13. data/lib/appsignal/demo.rb +15 -20
  14. data/lib/appsignal/environment.rb +6 -1
  15. data/lib/appsignal/event_formatter/rom/sql_formatter.rb +1 -0
  16. data/lib/appsignal/event_formatter.rb +3 -2
  17. data/lib/appsignal/helpers/instrumentation.rb +490 -16
  18. data/lib/appsignal/hooks/action_cable.rb +21 -16
  19. data/lib/appsignal/hooks/active_job.rb +15 -14
  20. data/lib/appsignal/hooks/delayed_job.rb +1 -1
  21. data/lib/appsignal/hooks/shoryuken.rb +3 -63
  22. data/lib/appsignal/integrations/action_cable.rb +5 -7
  23. data/lib/appsignal/integrations/active_support_notifications.rb +1 -0
  24. data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +36 -35
  25. data/lib/appsignal/integrations/data_mapper.rb +1 -0
  26. data/lib/appsignal/integrations/delayed_job_plugin.rb +27 -33
  27. data/lib/appsignal/integrations/dry_monitor.rb +1 -0
  28. data/lib/appsignal/integrations/excon.rb +1 -0
  29. data/lib/appsignal/integrations/http.rb +1 -0
  30. data/lib/appsignal/integrations/net_http.rb +1 -0
  31. data/lib/appsignal/integrations/object.rb +6 -0
  32. data/lib/appsignal/integrations/padrino.rb +21 -25
  33. data/lib/appsignal/integrations/que.rb +13 -20
  34. data/lib/appsignal/integrations/railtie.rb +1 -1
  35. data/lib/appsignal/integrations/rake.rb +45 -15
  36. data/lib/appsignal/integrations/redis.rb +1 -0
  37. data/lib/appsignal/integrations/redis_client.rb +1 -0
  38. data/lib/appsignal/integrations/resque.rb +2 -5
  39. data/lib/appsignal/integrations/shoryuken.rb +75 -0
  40. data/lib/appsignal/integrations/sidekiq.rb +7 -25
  41. data/lib/appsignal/integrations/unicorn.rb +1 -0
  42. data/lib/appsignal/integrations/webmachine.rb +12 -9
  43. data/lib/appsignal/logger.rb +7 -3
  44. data/lib/appsignal/probes/helpers.rb +1 -0
  45. data/lib/appsignal/probes/mri.rb +1 -0
  46. data/lib/appsignal/probes/sidekiq.rb +1 -0
  47. data/lib/appsignal/probes.rb +3 -0
  48. data/lib/appsignal/rack/abstract_middleware.rb +67 -24
  49. data/lib/appsignal/rack/body_wrapper.rb +143 -0
  50. data/lib/appsignal/rack/event_handler.rb +39 -8
  51. data/lib/appsignal/rack/generic_instrumentation.rb +6 -4
  52. data/lib/appsignal/rack/grape_middleware.rb +3 -2
  53. data/lib/appsignal/rack/hanami_middleware.rb +1 -1
  54. data/lib/appsignal/rack/instrumentation_middleware.rb +62 -0
  55. data/lib/appsignal/rack/rails_instrumentation.rb +1 -3
  56. data/lib/appsignal/rack/sinatra_instrumentation.rb +1 -3
  57. data/lib/appsignal/rack/streaming_listener.rb +14 -59
  58. data/lib/appsignal/rack.rb +60 -0
  59. data/lib/appsignal/span.rb +1 -0
  60. data/lib/appsignal/transaction.rb +353 -104
  61. data/lib/appsignal/utils/data.rb +0 -1
  62. data/lib/appsignal/utils/hash_sanitizer.rb +0 -1
  63. data/lib/appsignal/utils/integration_logger.rb +0 -13
  64. data/lib/appsignal/utils/integration_memory_logger.rb +0 -13
  65. data/lib/appsignal/utils/json.rb +0 -1
  66. data/lib/appsignal/utils/query_params_sanitizer.rb +0 -1
  67. data/lib/appsignal/utils/stdout_and_logger_message.rb +0 -1
  68. data/lib/appsignal/utils.rb +6 -0
  69. data/lib/appsignal/version.rb +1 -1
  70. data/lib/appsignal.rb +9 -6
  71. data/spec/lib/appsignal/capistrano2_spec.rb +1 -1
  72. data/spec/lib/appsignal/config_spec.rb +139 -43
  73. data/spec/lib/appsignal/hooks/action_cable_spec.rb +43 -74
  74. data/spec/lib/appsignal/hooks/activejob_spec.rb +9 -0
  75. data/spec/lib/appsignal/hooks/delayed_job_spec.rb +2 -443
  76. data/spec/lib/appsignal/hooks/rake_spec.rb +100 -17
  77. data/spec/lib/appsignal/hooks/shoryuken_spec.rb +0 -171
  78. data/spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb +459 -0
  79. data/spec/lib/appsignal/integrations/padrino_spec.rb +181 -131
  80. data/spec/lib/appsignal/integrations/que_spec.rb +3 -4
  81. data/spec/lib/appsignal/integrations/shoryuken_spec.rb +167 -0
  82. data/spec/lib/appsignal/integrations/sidekiq_spec.rb +4 -4
  83. data/spec/lib/appsignal/integrations/sinatra_spec.rb +10 -2
  84. data/spec/lib/appsignal/integrations/webmachine_spec.rb +77 -17
  85. data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +144 -11
  86. data/spec/lib/appsignal/rack/body_wrapper_spec.rb +263 -0
  87. data/spec/lib/appsignal/rack/event_handler_spec.rb +81 -10
  88. data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +70 -17
  89. data/spec/lib/appsignal/rack/grape_middleware_spec.rb +1 -1
  90. data/spec/lib/appsignal/rack/instrumentation_middleware_spec.rb +38 -0
  91. data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +4 -2
  92. data/spec/lib/appsignal/rack/streaming_listener_spec.rb +43 -120
  93. data/spec/lib/appsignal/rack_spec.rb +63 -0
  94. data/spec/lib/appsignal/transaction_spec.rb +1675 -953
  95. data/spec/lib/appsignal/utils/integration_logger_spec.rb +12 -16
  96. data/spec/lib/appsignal/utils/integration_memory_logger_spec.rb +0 -10
  97. data/spec/lib/appsignal_spec.rb +517 -13
  98. data/spec/support/helpers/transaction_helpers.rb +44 -20
  99. data/spec/support/matchers/transaction.rb +15 -1
  100. data/spec/support/mocks/dummy_app.rb +1 -1
  101. data/spec/support/testing.rb +1 -1
  102. metadata +12 -4
  103. data/support/check_versions +0 -22
@@ -7,26 +7,50 @@ module TransactionHelpers
7
7
  end
8
8
  end
9
9
 
10
- def background_job_transaction(args = {})
11
- Appsignal::Transaction.new(
12
- "1",
13
- Appsignal::Transaction::BACKGROUND_JOB,
14
- Appsignal::Transaction::GenericRequest.new({
15
- "SERVER_NAME" => "localhost",
16
- "action_dispatch.routes" => "not_available"
17
- }.merge(args))
18
- )
19
- end
20
-
21
- def http_request_transaction(args = {})
22
- Appsignal::Transaction.new(
23
- "1",
24
- Appsignal::Transaction::HTTP_REQUEST,
25
- Appsignal::Transaction::GenericRequest.new({
26
- "SERVER_NAME" => "localhost",
27
- "action_dispatch.routes" => "not_available"
28
- }.merge(args))
29
- )
10
+ def default_namespace
11
+ Appsignal::Transaction::HTTP_REQUEST
12
+ end
13
+
14
+ def create_transaction(namespace = default_namespace)
15
+ Appsignal::Transaction.create(namespace)
16
+ end
17
+
18
+ def new_transaction(namespace = default_namespace)
19
+ Appsignal::Transaction.new(SecureRandom.uuid, namespace)
20
+ end
21
+
22
+ def legacy_create_transaction(
23
+ id: "mock_transaction_id",
24
+ namespace: "mock_namespace",
25
+ request: legacy_request,
26
+ options: {}
27
+ )
28
+ Appsignal::Transaction.create(id, namespace, request, options)
29
+ end
30
+
31
+ def legacy_new_transaction(
32
+ id: "mock_transaction_id",
33
+ namespace: "mock_namespace",
34
+ request: legacy_request,
35
+ options: {}
36
+ )
37
+ Appsignal::Transaction.new(id, namespace, request, options)
38
+ end
39
+
40
+ def legacy_request(env = {})
41
+ Appsignal::Transaction::InternalGenericRequest.new(env)
42
+ end
43
+
44
+ def rack_request(env)
45
+ Rack::Request.new(env)
46
+ end
47
+
48
+ def background_job_transaction
49
+ new_transaction(Appsignal::Transaction::BACKGROUND_JOB)
50
+ end
51
+
52
+ def http_request_transaction
53
+ new_transaction(Appsignal::Transaction::HTTP_REQUEST)
30
54
  end
31
55
 
32
56
  # Returns the all {Appsignal::Transaction} objects created during this test
@@ -180,6 +180,20 @@ RSpec::Matchers.alias_matcher :include_breadcrumbs, :include_breadcrumb
180
180
 
181
181
  RSpec::Matchers.define :have_queue_start do |queue_start_time|
182
182
  match(:notify_expectation_failures => true) do |transaction|
183
- expect(transaction.ext.queue_start).to eq(queue_start_time)
183
+ actual_start = transaction.ext.queue_start
184
+ if queue_start_time
185
+ expect(actual_start).to eq(queue_start_time)
186
+ else
187
+ expect(actual_start).to_not be_nil
188
+ end
189
+ end
190
+
191
+ match_when_negated(:notify_expectation_failures => true) do |transaction|
192
+ actual_start = transaction.ext.queue_start
193
+ if queue_start_time
194
+ expect(actual_start).to_not eq(queue_start_time)
195
+ else
196
+ expect(actual_start).to be_nil
197
+ end
184
198
  end
185
199
  end
@@ -8,7 +8,7 @@ class DummyApp
8
8
  if @app
9
9
  @app&.call(env)
10
10
  else
11
- [200, {}, "body"]
11
+ [200, {}, ["body"]]
12
12
  end
13
13
  ensure
14
14
  @called = true
@@ -134,7 +134,7 @@ module AppsignalTest
134
134
 
135
135
  module InstanceMethods
136
136
  def _sample
137
- sample_data
137
+ _sample_data
138
138
  end
139
139
  end
140
140
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.3
4
+ version: 3.11.0
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Beekman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-07-02 00:00:00.000000000 Z
13
+ date: 2024-07-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -275,6 +275,7 @@ files:
275
275
  - lib/appsignal/integrations/redis.rb
276
276
  - lib/appsignal/integrations/redis_client.rb
277
277
  - lib/appsignal/integrations/resque.rb
278
+ - lib/appsignal/integrations/shoryuken.rb
278
279
  - lib/appsignal/integrations/sidekiq.rb
279
280
  - lib/appsignal/integrations/sinatra.rb
280
281
  - lib/appsignal/integrations/unicorn.rb
@@ -286,11 +287,14 @@ files:
286
287
  - lib/appsignal/probes/helpers.rb
287
288
  - lib/appsignal/probes/mri.rb
288
289
  - lib/appsignal/probes/sidekiq.rb
290
+ - lib/appsignal/rack.rb
289
291
  - lib/appsignal/rack/abstract_middleware.rb
292
+ - lib/appsignal/rack/body_wrapper.rb
290
293
  - lib/appsignal/rack/event_handler.rb
291
294
  - lib/appsignal/rack/generic_instrumentation.rb
292
295
  - lib/appsignal/rack/grape_middleware.rb
293
296
  - lib/appsignal/rack/hanami_middleware.rb
297
+ - lib/appsignal/rack/instrumentation_middleware.rb
294
298
  - lib/appsignal/rack/rails_instrumentation.rb
295
299
  - lib/appsignal/rack/sinatra_instrumentation.rb
296
300
  - lib/appsignal/rack/streaming_listener.rb
@@ -373,6 +377,7 @@ files:
373
377
  - spec/lib/appsignal/hooks/webmachine_spec.rb
374
378
  - spec/lib/appsignal/hooks_spec.rb
375
379
  - spec/lib/appsignal/integrations/data_mapper_spec.rb
380
+ - spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb
376
381
  - spec/lib/appsignal/integrations/hanami_spec.rb
377
382
  - spec/lib/appsignal/integrations/http_spec.rb
378
383
  - spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
@@ -381,6 +386,7 @@ files:
381
386
  - spec/lib/appsignal/integrations/padrino_spec.rb
382
387
  - spec/lib/appsignal/integrations/que_spec.rb
383
388
  - spec/lib/appsignal/integrations/railtie_spec.rb
389
+ - spec/lib/appsignal/integrations/shoryuken_spec.rb
384
390
  - spec/lib/appsignal/integrations/sidekiq_spec.rb
385
391
  - spec/lib/appsignal/integrations/sinatra_spec.rb
386
392
  - spec/lib/appsignal/integrations/webmachine_spec.rb
@@ -391,13 +397,16 @@ files:
391
397
  - spec/lib/appsignal/probes/sidekiq_spec.rb
392
398
  - spec/lib/appsignal/probes_spec.rb
393
399
  - spec/lib/appsignal/rack/abstract_middleware_spec.rb
400
+ - spec/lib/appsignal/rack/body_wrapper_spec.rb
394
401
  - spec/lib/appsignal/rack/event_handler_spec.rb
395
402
  - spec/lib/appsignal/rack/generic_instrumentation_spec.rb
396
403
  - spec/lib/appsignal/rack/grape_middleware_spec.rb
397
404
  - spec/lib/appsignal/rack/hanami_middleware_spec.rb
405
+ - spec/lib/appsignal/rack/instrumentation_middleware_spec.rb
398
406
  - spec/lib/appsignal/rack/rails_instrumentation_spec.rb
399
407
  - spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
400
408
  - spec/lib/appsignal/rack/streaming_listener_spec.rb
409
+ - spec/lib/appsignal/rack_spec.rb
401
410
  - spec/lib/appsignal/span_spec.rb
402
411
  - spec/lib/appsignal/system_spec.rb
403
412
  - spec/lib/appsignal/transaction_spec.rb
@@ -453,7 +462,6 @@ files:
453
462
  - spec/support/stubs/sidekiq/api.rb
454
463
  - spec/support/testing.rb
455
464
  - support/bundler_wrapper
456
- - support/check_versions
457
465
  - support/install_deps
458
466
  homepage: https://github.com/appsignal/appsignal-ruby
459
467
  licenses:
@@ -481,7 +489,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
481
489
  - !ruby/object:Gem::Version
482
490
  version: '0'
483
491
  requirements: []
484
- rubygems_version: 3.3.7
492
+ rubygems_version: 3.5.14
485
493
  signing_key:
486
494
  specification_version: 4
487
495
  summary: Logs performance and exception data from your app to appsignal.com
@@ -1,22 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -eu
4
-
5
- actual_ruby_version=$(ruby --version)
6
- if [[ "$actual_ruby_version" == *"jruby"* ]]; then
7
- # Replace "-" from specified RUBY_VERSION string. Semaphore/rbenv version uses
8
- # a dash, where `jruby --version` uses a space.
9
- sanitized_ruby_version="${RUBY_VERSION//-/ }"
10
- else
11
- # Strip "-" from specified RUBY_VERSION string. Semaphore/rbenv version uses
12
- # a dash, where `ruby --version` does not.
13
- sanitized_ruby_version="${RUBY_VERSION//-}"
14
- fi
15
- if [[ "$actual_ruby_version" == *"$sanitized_ruby_version"* ]]; then
16
- echo "Ruby version is $RUBY_VERSION"
17
- exit 0
18
- else
19
- echo "Ruby version is: $actual_ruby_version"
20
- echo "Ruby version should be: $sanitized_ruby_version"
21
- exit 1
22
- fi