appsignal 3.0.15-java → 3.0.19-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -3
  3. data/.semaphore/semaphore.yml +513 -104
  4. data/CHANGELOG.md +57 -0
  5. data/appsignal.gemspec +0 -2
  6. data/build_matrix.yml +45 -17
  7. data/ext/agent.yml +25 -25
  8. data/ext/appsignal_extension.c +201 -0
  9. data/ext/base.rb +2 -1
  10. data/gemfiles/rails-6.1.gemfile +7 -0
  11. data/gemfiles/rails-7.0.gemfile +7 -0
  12. data/lib/appsignal/cli/diagnose/utils.rb +0 -14
  13. data/lib/appsignal/cli/diagnose.rb +19 -8
  14. data/lib/appsignal/config.rb +89 -57
  15. data/lib/appsignal/event_formatter/sequel/sql_formatter.rb +24 -0
  16. data/lib/appsignal/extension/jruby.rb +147 -0
  17. data/lib/appsignal/extension.rb +5 -0
  18. data/lib/appsignal/integrations/sidekiq.rb +5 -1
  19. data/lib/appsignal/span.rb +92 -0
  20. data/lib/appsignal/system.rb +0 -4
  21. data/lib/appsignal/transaction.rb +12 -1
  22. data/lib/appsignal/version.rb +1 -1
  23. data/lib/appsignal.rb +4 -10
  24. data/script/lint_git +1 -1
  25. data/spec/lib/appsignal/cli/diagnose_spec.rb +18 -13
  26. data/spec/lib/appsignal/config_spec.rb +104 -20
  27. data/spec/lib/appsignal/event_formatter/active_record/sql_formatter_spec.rb +2 -2
  28. data/spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb +30 -0
  29. data/spec/lib/appsignal/event_formatter_spec.rb +2 -2
  30. data/spec/lib/appsignal/hooks/activejob_spec.rb +17 -6
  31. data/spec/lib/appsignal/hooks/sequel_spec.rb +1 -1
  32. data/spec/lib/appsignal/integrations/padrino_spec.rb +8 -2
  33. data/spec/lib/appsignal/integrations/sidekiq_spec.rb +23 -5
  34. data/spec/lib/appsignal/span_spec.rb +141 -0
  35. data/spec/lib/appsignal/transaction_spec.rb +25 -0
  36. data/spec/lib/appsignal/utils/data_spec.rb +0 -2
  37. data/spec/lib/appsignal/utils/json_spec.rb +0 -2
  38. data/spec/lib/appsignal_spec.rb +2 -3
  39. data/spec/support/helpers/activejob_helpers.rb +27 -0
  40. data/spec/support/helpers/dependency_helper.rb +13 -1
  41. metadata +13 -3
@@ -1341,6 +1341,31 @@ describe Appsignal::Transaction do
1341
1341
  end
1342
1342
  end
1343
1343
 
1344
+ describe "#cleaned_error_message" do
1345
+ let(:error) { StandardError.new("Error message") }
1346
+ subject { transaction.send(:cleaned_error_message, error) }
1347
+
1348
+ it "returns the error message" do
1349
+ expect(subject).to eq "Error message"
1350
+ end
1351
+
1352
+ context "with a PG::UniqueViolation" do
1353
+ module PG
1354
+ class UniqueViolation < StandardError; end
1355
+ end
1356
+
1357
+ let(:error) do
1358
+ PG::UniqueViolation.new(
1359
+ "ERROR: duplicate key value violates unique constraint \"index_users_on_email\" DETAIL: Key (email)=(test@test.com) already exists."
1360
+ )
1361
+ end
1362
+
1363
+ it "returns a sanizited error message" do
1364
+ expect(subject).to eq "ERROR: duplicate key value violates unique constraint \"index_users_on_email\" DETAIL: Key (email)=(?) already exists."
1365
+ end
1366
+ end
1367
+ end
1368
+
1344
1369
  describe ".to_hash / .to_h" do
1345
1370
  subject { transaction.to_hash }
1346
1371
 
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  describe Appsignal::Utils::Data do
4
2
  describe ".generate" do
5
3
  subject { Appsignal::Utils::Data.generate(body) }
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  describe Appsignal::Utils::JSON do
4
2
  describe ".generate" do
5
3
  subject { Appsignal::Utils::JSON.generate(body) }
@@ -86,8 +86,7 @@ describe Appsignal do
86
86
  expect_environment_metadata("ruby_gc_instrumentation_enabled", "true")
87
87
  end
88
88
 
89
- unless Appsignal::System.jruby?
90
-
89
+ unless DependencyHelper.running_jruby?
91
90
  it "installs the allocation event hook" do
92
91
  expect(Appsignal::Extension).to receive(:install_allocation_event_hook)
93
92
  .and_call_original
@@ -1236,7 +1235,7 @@ describe Appsignal do
1236
1235
  before do
1237
1236
  capture_stdout(out_stream) do
1238
1237
  initialize_config
1239
- Appsignal.config[:debug] = true
1238
+ Appsignal.config[:log_level] = "debug"
1240
1239
  Appsignal.start_logger
1241
1240
  end
1242
1241
  end
@@ -0,0 +1,27 @@
1
+ module ActiveJobHelpers
2
+ def active_job_args_wrapper(args: [], params: nil)
3
+ if (DependencyHelper.rails6_1_present? && DependencyHelper.ruby_3_1_or_newer?) || DependencyHelper.rails7_present?
4
+ wrapped_args = {}
5
+
6
+ if params
7
+ if DependencyHelper.rails7_present?
8
+ wrapped_args["_aj_ruby2_keywords"] = ["params", "args"]
9
+ wrapped_args["args"] = []
10
+ wrapped_args["params"] = {
11
+ "_aj_symbol_keys" => ["foo"]
12
+ }.merge(params)
13
+ else
14
+ wrapped_args["_aj_symbol_keys"] = ["foo"]
15
+ wrapped_args.merge!(params)
16
+ end
17
+ else
18
+ wrapped_args["_aj_ruby2_keywords"] = ["args"]
19
+ wrapped_args["args"] = args
20
+ end
21
+
22
+ [wrapped_args]
23
+ else
24
+ params.nil? ? args : args + [params]
25
+ end
26
+ end
27
+ end
@@ -9,8 +9,12 @@ module DependencyHelper
9
9
  ruby_version.segments.take(2) == [2, 0]
10
10
  end
11
11
 
12
+ def ruby_3_1_or_newer?
13
+ ruby_version >= Gem::Version.new("3.1.0")
14
+ end
15
+
12
16
  def running_jruby?
13
- defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
17
+ Appsignal::System.jruby?
14
18
  end
15
19
 
16
20
  def rails_present?
@@ -21,6 +25,14 @@ module DependencyHelper
21
25
  rails_present? && rails_version >= Gem::Version.new("6.0.0")
22
26
  end
23
27
 
28
+ def rails6_1_present?
29
+ rails_present? && rails_version >= Gem::Version.new("6.1.0")
30
+ end
31
+
32
+ def rails7_present?
33
+ rails_present? && rails_version >= Gem::Version.new("7.0.0")
34
+ end
35
+
24
36
  def rails_version
25
37
  Gem.loaded_specs["rails"].version
26
38
  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.0.15
4
+ version: 3.0.19
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: 2021-11-03 00:00:00.000000000 Z
13
+ date: 2022-01-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -185,6 +185,8 @@ files:
185
185
  - gemfiles/rails-5.1.gemfile
186
186
  - gemfiles/rails-5.2.gemfile
187
187
  - gemfiles/rails-6.0.gemfile
188
+ - gemfiles/rails-6.1.gemfile
189
+ - gemfiles/rails-7.0.gemfile
188
190
  - gemfiles/resque-1.gemfile
189
191
  - gemfiles/resque-2.gemfile
190
192
  - gemfiles/sequel-435.gemfile
@@ -212,6 +214,7 @@ files:
212
214
  - lib/appsignal/event_formatter/faraday/request_formatter.rb
213
215
  - lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb
214
216
  - lib/appsignal/event_formatter/moped/query_formatter.rb
217
+ - lib/appsignal/event_formatter/sequel/sql_formatter.rb
215
218
  - lib/appsignal/extension.rb
216
219
  - lib/appsignal/extension/jruby.rb
217
220
  - lib/appsignal/garbage_collection_profiler.rb
@@ -271,6 +274,7 @@ files:
271
274
  - lib/appsignal/rack/rails_instrumentation.rb
272
275
  - lib/appsignal/rack/sinatra_instrumentation.rb
273
276
  - lib/appsignal/rack/streaming_listener.rb
277
+ - lib/appsignal/span.rb
274
278
  - lib/appsignal/system.rb
275
279
  - lib/appsignal/transaction.rb
276
280
  - lib/appsignal/transmitter.rb
@@ -309,6 +313,7 @@ files:
309
313
  - spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb
310
314
  - spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb
311
315
  - spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb
316
+ - spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb
312
317
  - spec/lib/appsignal/event_formatter_spec.rb
313
318
  - spec/lib/appsignal/extension/jruby_spec.rb
314
319
  - spec/lib/appsignal/extension_install_failure_spec.rb
@@ -359,6 +364,7 @@ files:
359
364
  - spec/lib/appsignal/rack/rails_instrumentation_spec.rb
360
365
  - spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
361
366
  - spec/lib/appsignal/rack/streaming_listener_spec.rb
367
+ - spec/lib/appsignal/span_spec.rb
362
368
  - spec/lib/appsignal/system_spec.rb
363
369
  - spec/lib/appsignal/transaction_spec.rb
364
370
  - spec/lib/appsignal/transmitter_spec.rb
@@ -379,6 +385,7 @@ files:
379
385
  - spec/support/fixtures/projects/valid/log/.gitkeep
380
386
  - spec/support/fixtures/uploaded_file.txt
381
387
  - spec/support/helpers/action_mailer_helpers.rb
388
+ - spec/support/helpers/activejob_helpers.rb
382
389
  - spec/support/helpers/api_request_helper.rb
383
390
  - spec/support/helpers/cli_helpers.rb
384
391
  - spec/support/helpers/config_helpers.rb
@@ -433,7 +440,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
433
440
  - !ruby/object:Gem::Version
434
441
  version: '0'
435
442
  requirements: []
436
- rubygems_version: 3.2.30
443
+ rubygems_version: 3.3.4
437
444
  signing_key:
438
445
  specification_version: 4
439
446
  summary: Logs performance and exception data from your app to appsignal.com
@@ -459,6 +466,7 @@ test_files:
459
466
  - spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb
460
467
  - spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb
461
468
  - spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb
469
+ - spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb
462
470
  - spec/lib/appsignal/event_formatter_spec.rb
463
471
  - spec/lib/appsignal/extension/jruby_spec.rb
464
472
  - spec/lib/appsignal/extension_install_failure_spec.rb
@@ -509,6 +517,7 @@ test_files:
509
517
  - spec/lib/appsignal/rack/rails_instrumentation_spec.rb
510
518
  - spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
511
519
  - spec/lib/appsignal/rack/streaming_listener_spec.rb
520
+ - spec/lib/appsignal/span_spec.rb
512
521
  - spec/lib/appsignal/system_spec.rb
513
522
  - spec/lib/appsignal/transaction_spec.rb
514
523
  - spec/lib/appsignal/transmitter_spec.rb
@@ -529,6 +538,7 @@ test_files:
529
538
  - spec/support/fixtures/projects/valid/log/.gitkeep
530
539
  - spec/support/fixtures/uploaded_file.txt
531
540
  - spec/support/helpers/action_mailer_helpers.rb
541
+ - spec/support/helpers/activejob_helpers.rb
532
542
  - spec/support/helpers/api_request_helper.rb
533
543
  - spec/support/helpers/cli_helpers.rb
534
544
  - spec/support/helpers/config_helpers.rb