appsignal 3.9.3 → 3.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +22 -19
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +180 -0
- data/Gemfile +1 -0
- data/README.md +0 -1
- data/Rakefile +1 -1
- data/benchmark.rake +99 -42
- data/build_matrix.yml +10 -12
- data/gemfiles/webmachine1.gemfile +5 -4
- data/lib/appsignal/cli/demo.rb +0 -1
- data/lib/appsignal/config.rb +57 -97
- data/lib/appsignal/demo.rb +15 -20
- data/lib/appsignal/environment.rb +6 -1
- data/lib/appsignal/event_formatter/rom/sql_formatter.rb +1 -0
- data/lib/appsignal/event_formatter.rb +3 -2
- data/lib/appsignal/helpers/instrumentation.rb +490 -16
- data/lib/appsignal/hooks/action_cable.rb +21 -16
- data/lib/appsignal/hooks/active_job.rb +15 -14
- data/lib/appsignal/hooks/delayed_job.rb +1 -1
- data/lib/appsignal/hooks/shoryuken.rb +3 -63
- data/lib/appsignal/integrations/action_cable.rb +5 -7
- data/lib/appsignal/integrations/active_support_notifications.rb +1 -0
- data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +36 -35
- data/lib/appsignal/integrations/data_mapper.rb +1 -0
- data/lib/appsignal/integrations/delayed_job_plugin.rb +27 -33
- data/lib/appsignal/integrations/dry_monitor.rb +1 -0
- data/lib/appsignal/integrations/excon.rb +1 -0
- data/lib/appsignal/integrations/http.rb +1 -0
- data/lib/appsignal/integrations/net_http.rb +1 -0
- data/lib/appsignal/integrations/object.rb +6 -0
- data/lib/appsignal/integrations/padrino.rb +21 -25
- data/lib/appsignal/integrations/que.rb +13 -20
- data/lib/appsignal/integrations/railtie.rb +1 -1
- data/lib/appsignal/integrations/rake.rb +45 -15
- data/lib/appsignal/integrations/redis.rb +1 -0
- data/lib/appsignal/integrations/redis_client.rb +1 -0
- data/lib/appsignal/integrations/resque.rb +2 -5
- data/lib/appsignal/integrations/shoryuken.rb +75 -0
- data/lib/appsignal/integrations/sidekiq.rb +7 -25
- data/lib/appsignal/integrations/unicorn.rb +1 -0
- data/lib/appsignal/integrations/webmachine.rb +12 -9
- data/lib/appsignal/logger.rb +7 -3
- data/lib/appsignal/probes/helpers.rb +1 -0
- data/lib/appsignal/probes/mri.rb +1 -0
- data/lib/appsignal/probes/sidekiq.rb +1 -0
- data/lib/appsignal/probes.rb +3 -0
- data/lib/appsignal/rack/abstract_middleware.rb +67 -24
- data/lib/appsignal/rack/body_wrapper.rb +143 -0
- data/lib/appsignal/rack/event_handler.rb +39 -8
- data/lib/appsignal/rack/generic_instrumentation.rb +6 -4
- data/lib/appsignal/rack/grape_middleware.rb +3 -2
- data/lib/appsignal/rack/hanami_middleware.rb +1 -1
- data/lib/appsignal/rack/instrumentation_middleware.rb +62 -0
- data/lib/appsignal/rack/rails_instrumentation.rb +1 -3
- data/lib/appsignal/rack/sinatra_instrumentation.rb +1 -3
- data/lib/appsignal/rack/streaming_listener.rb +14 -59
- data/lib/appsignal/rack.rb +60 -0
- data/lib/appsignal/span.rb +1 -0
- data/lib/appsignal/transaction.rb +353 -104
- data/lib/appsignal/utils/data.rb +0 -1
- data/lib/appsignal/utils/hash_sanitizer.rb +0 -1
- data/lib/appsignal/utils/integration_logger.rb +0 -13
- data/lib/appsignal/utils/integration_memory_logger.rb +0 -13
- data/lib/appsignal/utils/json.rb +0 -1
- data/lib/appsignal/utils/query_params_sanitizer.rb +0 -1
- data/lib/appsignal/utils/stdout_and_logger_message.rb +0 -1
- data/lib/appsignal/utils.rb +6 -0
- data/lib/appsignal/version.rb +1 -1
- data/lib/appsignal.rb +9 -6
- data/spec/lib/appsignal/capistrano2_spec.rb +1 -1
- data/spec/lib/appsignal/config_spec.rb +139 -43
- data/spec/lib/appsignal/hooks/action_cable_spec.rb +43 -74
- data/spec/lib/appsignal/hooks/activejob_spec.rb +9 -0
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +2 -443
- data/spec/lib/appsignal/hooks/rake_spec.rb +100 -17
- data/spec/lib/appsignal/hooks/shoryuken_spec.rb +0 -171
- data/spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb +459 -0
- data/spec/lib/appsignal/integrations/padrino_spec.rb +181 -131
- data/spec/lib/appsignal/integrations/que_spec.rb +3 -4
- data/spec/lib/appsignal/integrations/shoryuken_spec.rb +167 -0
- data/spec/lib/appsignal/integrations/sidekiq_spec.rb +4 -4
- data/spec/lib/appsignal/integrations/sinatra_spec.rb +10 -2
- data/spec/lib/appsignal/integrations/webmachine_spec.rb +77 -17
- data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +144 -11
- data/spec/lib/appsignal/rack/body_wrapper_spec.rb +263 -0
- data/spec/lib/appsignal/rack/event_handler_spec.rb +81 -10
- data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +70 -17
- data/spec/lib/appsignal/rack/grape_middleware_spec.rb +1 -1
- data/spec/lib/appsignal/rack/instrumentation_middleware_spec.rb +38 -0
- data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +4 -2
- data/spec/lib/appsignal/rack/streaming_listener_spec.rb +43 -120
- data/spec/lib/appsignal/rack_spec.rb +63 -0
- data/spec/lib/appsignal/transaction_spec.rb +1675 -953
- data/spec/lib/appsignal/utils/integration_logger_spec.rb +12 -16
- data/spec/lib/appsignal/utils/integration_memory_logger_spec.rb +0 -10
- data/spec/lib/appsignal_spec.rb +517 -13
- data/spec/support/helpers/transaction_helpers.rb +44 -20
- data/spec/support/matchers/transaction.rb +15 -1
- data/spec/support/mocks/dummy_app.rb +1 -1
- data/spec/support/testing.rb +1 -1
- metadata +12 -4
- data/support/check_versions +0 -22
@@ -7,26 +7,50 @@ module TransactionHelpers
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
Appsignal::Transaction
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
-
|
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
|
data/spec/support/testing.rb
CHANGED
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.
|
4
|
+
version: 3.11.0
|
5
5
|
platform: ruby
|
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-
|
13
|
+
date: 2024-07-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -261,6 +261,7 @@ files:
|
|
261
261
|
- lib/appsignal/integrations/redis.rb
|
262
262
|
- lib/appsignal/integrations/redis_client.rb
|
263
263
|
- lib/appsignal/integrations/resque.rb
|
264
|
+
- lib/appsignal/integrations/shoryuken.rb
|
264
265
|
- lib/appsignal/integrations/sidekiq.rb
|
265
266
|
- lib/appsignal/integrations/sinatra.rb
|
266
267
|
- lib/appsignal/integrations/unicorn.rb
|
@@ -272,11 +273,14 @@ files:
|
|
272
273
|
- lib/appsignal/probes/helpers.rb
|
273
274
|
- lib/appsignal/probes/mri.rb
|
274
275
|
- lib/appsignal/probes/sidekiq.rb
|
276
|
+
- lib/appsignal/rack.rb
|
275
277
|
- lib/appsignal/rack/abstract_middleware.rb
|
278
|
+
- lib/appsignal/rack/body_wrapper.rb
|
276
279
|
- lib/appsignal/rack/event_handler.rb
|
277
280
|
- lib/appsignal/rack/generic_instrumentation.rb
|
278
281
|
- lib/appsignal/rack/grape_middleware.rb
|
279
282
|
- lib/appsignal/rack/hanami_middleware.rb
|
283
|
+
- lib/appsignal/rack/instrumentation_middleware.rb
|
280
284
|
- lib/appsignal/rack/rails_instrumentation.rb
|
281
285
|
- lib/appsignal/rack/sinatra_instrumentation.rb
|
282
286
|
- lib/appsignal/rack/streaming_listener.rb
|
@@ -359,6 +363,7 @@ files:
|
|
359
363
|
- spec/lib/appsignal/hooks/webmachine_spec.rb
|
360
364
|
- spec/lib/appsignal/hooks_spec.rb
|
361
365
|
- spec/lib/appsignal/integrations/data_mapper_spec.rb
|
366
|
+
- spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb
|
362
367
|
- spec/lib/appsignal/integrations/hanami_spec.rb
|
363
368
|
- spec/lib/appsignal/integrations/http_spec.rb
|
364
369
|
- spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
|
@@ -367,6 +372,7 @@ files:
|
|
367
372
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
368
373
|
- spec/lib/appsignal/integrations/que_spec.rb
|
369
374
|
- spec/lib/appsignal/integrations/railtie_spec.rb
|
375
|
+
- spec/lib/appsignal/integrations/shoryuken_spec.rb
|
370
376
|
- spec/lib/appsignal/integrations/sidekiq_spec.rb
|
371
377
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
372
378
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
@@ -377,13 +383,16 @@ files:
|
|
377
383
|
- spec/lib/appsignal/probes/sidekiq_spec.rb
|
378
384
|
- spec/lib/appsignal/probes_spec.rb
|
379
385
|
- spec/lib/appsignal/rack/abstract_middleware_spec.rb
|
386
|
+
- spec/lib/appsignal/rack/body_wrapper_spec.rb
|
380
387
|
- spec/lib/appsignal/rack/event_handler_spec.rb
|
381
388
|
- spec/lib/appsignal/rack/generic_instrumentation_spec.rb
|
382
389
|
- spec/lib/appsignal/rack/grape_middleware_spec.rb
|
383
390
|
- spec/lib/appsignal/rack/hanami_middleware_spec.rb
|
391
|
+
- spec/lib/appsignal/rack/instrumentation_middleware_spec.rb
|
384
392
|
- spec/lib/appsignal/rack/rails_instrumentation_spec.rb
|
385
393
|
- spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
|
386
394
|
- spec/lib/appsignal/rack/streaming_listener_spec.rb
|
395
|
+
- spec/lib/appsignal/rack_spec.rb
|
387
396
|
- spec/lib/appsignal/span_spec.rb
|
388
397
|
- spec/lib/appsignal/system_spec.rb
|
389
398
|
- spec/lib/appsignal/transaction_spec.rb
|
@@ -439,7 +448,6 @@ files:
|
|
439
448
|
- spec/support/stubs/sidekiq/api.rb
|
440
449
|
- spec/support/testing.rb
|
441
450
|
- support/bundler_wrapper
|
442
|
-
- support/check_versions
|
443
451
|
- support/install_deps
|
444
452
|
homepage: https://github.com/appsignal/appsignal-ruby
|
445
453
|
licenses:
|
@@ -467,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
467
475
|
- !ruby/object:Gem::Version
|
468
476
|
version: '0'
|
469
477
|
requirements: []
|
470
|
-
rubygems_version: 3.
|
478
|
+
rubygems_version: 3.5.14
|
471
479
|
signing_key:
|
472
480
|
specification_version: 4
|
473
481
|
summary: Logs performance and exception data from your app to appsignal.com
|
data/support/check_versions
DELETED
@@ -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
|