appsignal 3.13.0-java → 4.0.0.beta.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +499 -487
  3. data/CHANGELOG.md +121 -0
  4. data/Rakefile +31 -7
  5. data/benchmark.rake +4 -6
  6. data/build_matrix.yml +45 -39
  7. data/ext/agent.rb +27 -27
  8. data/ext/appsignal_extension.c +25 -0
  9. data/gemfiles/rails-7.2.gemfile +11 -0
  10. data/lib/appsignal/check_in/cron.rb +2 -15
  11. data/lib/appsignal/cli/diagnose.rb +37 -28
  12. data/lib/appsignal/cli/install.rb +5 -1
  13. data/lib/appsignal/config.rb +57 -119
  14. data/lib/appsignal/demo.rb +2 -2
  15. data/lib/appsignal/extension/jruby.rb +14 -0
  16. data/lib/appsignal/helpers/instrumentation.rb +152 -416
  17. data/lib/appsignal/helpers/metrics.rb +0 -16
  18. data/lib/appsignal/hooks/action_cable.rb +8 -8
  19. data/lib/appsignal/hooks/active_job.rb +2 -2
  20. data/lib/appsignal/hooks/at_exit.rb +37 -0
  21. data/lib/appsignal/hooks.rb +1 -16
  22. data/lib/appsignal/integrations/action_cable.rb +2 -2
  23. data/lib/appsignal/integrations/capistrano/appsignal.cap +2 -4
  24. data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +1 -4
  25. data/lib/appsignal/integrations/delayed_job_plugin.rb +3 -3
  26. data/lib/appsignal/integrations/que.rb +2 -2
  27. data/lib/appsignal/integrations/railtie.rb +26 -59
  28. data/lib/appsignal/integrations/rake.rb +2 -2
  29. data/lib/appsignal/integrations/resque.rb +2 -2
  30. data/lib/appsignal/integrations/shoryuken.rb +4 -4
  31. data/lib/appsignal/integrations/sidekiq.rb +3 -3
  32. data/lib/appsignal/integrations/webmachine.rb +2 -2
  33. data/lib/appsignal/loaders.rb +1 -1
  34. data/lib/appsignal/probes.rb +0 -9
  35. data/lib/appsignal/rack/abstract_middleware.rb +4 -26
  36. data/lib/appsignal/rack/event_handler.rb +4 -4
  37. data/lib/appsignal/rack/rails_instrumentation.rb +1 -1
  38. data/lib/appsignal/rack.rb +0 -25
  39. data/lib/appsignal/sample_data.rb +108 -0
  40. data/lib/appsignal/transaction.rb +241 -359
  41. data/lib/appsignal/utils/rails_helper.rb +4 -0
  42. data/lib/appsignal/version.rb +1 -1
  43. data/lib/appsignal.rb +19 -71
  44. data/spec/lib/appsignal/auth_check_spec.rb +1 -1
  45. data/spec/lib/appsignal/capistrano2_spec.rb +1 -1
  46. data/spec/lib/appsignal/capistrano3_spec.rb +53 -13
  47. data/spec/lib/appsignal/check_in_spec.rb +1 -207
  48. data/spec/lib/appsignal/cli/demo_spec.rb +7 -27
  49. data/spec/lib/appsignal/cli/diagnose_spec.rb +145 -110
  50. data/spec/lib/appsignal/config_spec.rb +304 -379
  51. data/spec/lib/appsignal/extension_install_failure_spec.rb +5 -1
  52. data/spec/lib/appsignal/extension_spec.rb +5 -1
  53. data/spec/lib/appsignal/hooks/active_support_notifications/instrument_shared_examples.rb +1 -1
  54. data/spec/lib/appsignal/hooks/active_support_notifications/start_finish_shared_examples.rb +1 -2
  55. data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +1 -0
  56. data/spec/lib/appsignal/hooks/activejob_spec.rb +7 -12
  57. data/spec/lib/appsignal/hooks/at_exit_spec.rb +72 -0
  58. data/spec/lib/appsignal/hooks/gvl_spec.rb +10 -5
  59. data/spec/lib/appsignal/hooks/http_spec.rb +3 -3
  60. data/spec/lib/appsignal/hooks/net_http_spec.rb +3 -3
  61. data/spec/lib/appsignal/hooks/rake_spec.rb +6 -9
  62. data/spec/lib/appsignal/hooks/redis_client_spec.rb +5 -10
  63. data/spec/lib/appsignal/hooks/redis_spec.rb +4 -7
  64. data/spec/lib/appsignal/hooks/resque_spec.rb +3 -5
  65. data/spec/lib/appsignal/hooks_spec.rb +0 -41
  66. data/spec/lib/appsignal/integrations/data_mapper_spec.rb +29 -20
  67. data/spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb +4 -9
  68. data/spec/lib/appsignal/integrations/railtie_spec.rb +179 -157
  69. data/spec/lib/appsignal/integrations/shoryuken_spec.rb +3 -5
  70. data/spec/lib/appsignal/integrations/sidekiq_spec.rb +48 -62
  71. data/spec/lib/appsignal/loaders/hanami_spec.rb +6 -9
  72. data/spec/lib/appsignal/loaders/padrino_spec.rb +6 -10
  73. data/spec/lib/appsignal/loaders/sinatra_spec.rb +6 -9
  74. data/spec/lib/appsignal/loaders_spec.rb +8 -1
  75. data/spec/lib/appsignal/marker_spec.rb +1 -1
  76. data/spec/lib/appsignal/probes_spec.rb +4 -83
  77. data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +4 -63
  78. data/spec/lib/appsignal/rack/event_handler_spec.rb +18 -15
  79. data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +3 -11
  80. data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +4 -5
  81. data/spec/lib/appsignal/sample_data_spec.rb +213 -0
  82. data/spec/lib/appsignal/transaction_spec.rb +817 -1046
  83. data/spec/lib/appsignal/transmitter_spec.rb +6 -8
  84. data/spec/lib/appsignal_spec.rb +311 -643
  85. data/spec/spec_helper.rb +1 -3
  86. data/spec/support/fixtures/projects/valid/config/appsignal.yml +4 -7
  87. data/spec/support/fixtures/projects/valid_with_rails_app/config/application.rb +16 -0
  88. data/spec/support/fixtures/projects/valid_with_rails_app/config/appsignal.yml +56 -0
  89. data/spec/support/fixtures/projects/valid_with_rails_app/config/environment.rb +5 -0
  90. data/spec/support/helpers/api_request_helper.rb +3 -2
  91. data/spec/support/helpers/config_helpers.rb +41 -11
  92. data/spec/support/helpers/dependency_helper.rb +8 -0
  93. data/spec/support/helpers/log_helpers.rb +1 -0
  94. data/spec/support/helpers/rails_helper.rb +6 -6
  95. data/spec/support/helpers/transaction_helpers.rb +2 -24
  96. data/spec/support/matchers/transaction.rb +3 -3
  97. data/spec/support/mocks/appsignal_mock.rb +3 -3
  98. data/spec/support/mocks/mock_probe.rb +2 -0
  99. data/spec/support/testing.rb +2 -2
  100. metadata +12 -22
  101. data/gemfiles/que_beta.gemfile +0 -5
  102. data/lib/appsignal/helpers/heartbeat.rb +0 -20
  103. data/lib/appsignal/integrations/grape.rb +0 -35
  104. data/lib/appsignal/integrations/hanami.rb +0 -13
  105. data/lib/appsignal/integrations/padrino.rb +0 -13
  106. data/lib/appsignal/integrations/sinatra.rb +0 -13
  107. data/lib/appsignal/rack/generic_instrumentation.rb +0 -22
  108. data/lib/appsignal/rack/streaming_listener.rb +0 -28
  109. data/spec/lib/appsignal/integrations/grape_spec.rb +0 -36
  110. data/spec/lib/appsignal/integrations/hanami_spec.rb +0 -17
  111. data/spec/lib/appsignal/integrations/padrino_spec.rb +0 -15
  112. data/spec/lib/appsignal/integrations/sinatra_spec.rb +0 -15
  113. data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +0 -81
  114. data/spec/lib/appsignal/rack/streaming_listener_spec.rb +0 -69
  115. data/spec/support/fixtures/projects/valid/config/environments/development.rb +0 -0
  116. data/spec/support/fixtures/projects/valid/config/environments/production.rb +0 -0
  117. data/spec/support/fixtures/projects/valid/config/environments/test.rb +0 -0
  118. data/spec/support/rails/my_app.rb +0 -6
  119. /data/spec/support/fixtures/projects/{valid/config/application.rb → valid_with_rails_app/log/.gitkeep} +0 -0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,126 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 4.0.0.beta.2
4
+
5
+ _Published on 2024-08-19._
6
+
7
+ ### Added
8
+
9
+ - Add a helper for parameters sample data to be unset. This is a private method until we stabilize it. (patch [e9336363](https://github.com/appsignal/appsignal-ruby/commit/e9336363fa869c88ab925f57e86ead45e8e18c29))
10
+
11
+ ## 4.0.0.beta.1
12
+
13
+ _Published on 2024-08-19._
14
+
15
+ ### Added
16
+
17
+ - Add an `at_exit` callback error reporter. By default, AppSignal will now report any unhandled errors that crash the process as long as Appsignal started beforehand.
18
+
19
+ ```ruby
20
+ require "appsignal"
21
+
22
+ Appsignal.start
23
+
24
+ raise "oh no!"
25
+
26
+ # Will report the error StandardError "oh no!"
27
+ ```
28
+
29
+ To disable this behavior, set the `enable_at_exit_reporter` config option to `false`.
30
+
31
+ (major [5124b0e9](https://github.com/appsignal/appsignal-ruby/commit/5124b0e903f04a5aff5bfaeaa7ff174170b413e7))
32
+ - Report errors from Rails runners. When a Rails runner reports an unhandled error, it will now report the error in the "runner" namespace. (minor [4d6add1d](https://github.com/appsignal/appsignal-ruby/commit/4d6add1d92255b8e1e6c8187f70258477dc05027))
33
+ - Support adding multiple errors to a transaction.
34
+
35
+ Using the `Appsignal.report_error` helper, you can now report more than one error within the same transaction context, up to a maximum of ten errors per transaction. Each error will be reported as a separate sample in the AppSignal UI.
36
+
37
+ Before this change, using `Appsignal.report_error` or `Appsignal.set_error` helpers, adding a new error within the same transaction would overwrite the previous one.
38
+
39
+ (patch [70ffc00a](https://github.com/appsignal/appsignal-ruby/commit/70ffc00ad31b19c2b91a915f58e3db4c9857201b))
40
+
41
+ ### Changed
42
+
43
+ - Change the default Rake task namespace to "rake". Previously, Rake tasks were reported in the "background" namespace. (major [7673b13c](https://github.com/appsignal/appsignal-ruby/commit/7673b13c933f1944d94d780bb6943cb2c7036a4d))
44
+ - Do not start AppSignal when the config file raises an error. Previously, the file source would be ignored. (major [17933fd9](https://github.com/appsignal/appsignal-ruby/commit/17933fd90e9236ca1f825bb76f849b0daf066498))
45
+ - Freeze the config after AppSignal has started. Prevent the config from being modified after AppSignal has started to avoid the expectation that modifying the config after starting AppSignal has any effect. (major [46f23f15](https://github.com/appsignal/appsignal-ruby/commit/46f23f15035e0bb56fd099f4c304960437e5afce))
46
+ - Do not start Appsignal multiple times if `Appsignal.start` is called more than once. The configuration can no longer be modified after AppSignal has started. (major [fbc2410a](https://github.com/appsignal/appsignal-ruby/commit/fbc2410a9a7e0d9b40240fc3e7e7557ed0a001c0))
47
+ - The transaction sample data is now merged by default. Previously, the sample data (except for tags) would be overwritten when a sample data helper was called.
48
+
49
+ ```ruby
50
+ # Old behavior
51
+ Appsignal.set_params("param1" => "value")
52
+ Appsignal.set_params("param2" => "value")
53
+ # The parameters are:
54
+ # { "param2" => "value" }
55
+
56
+
57
+ # New behavior
58
+ Appsignal.add_params("param1" => "value")
59
+ Appsignal.add_params("param2" => "value")
60
+ # The parameters are:
61
+ # { "param1" => "value", "param2" => "value" }
62
+ ```
63
+
64
+ New helpers have been added:
65
+
66
+ - `Appsignal.add_tags`
67
+ - `Appsignal.add_params`
68
+ - `Appsignal.add_session_data`
69
+ - `Appsignal.add_headers`
70
+ - `Appsignal.add_custom_data`
71
+
72
+ The old named helpers that start with `set_` will still work. They will also use the new merging behavior.
73
+
74
+ (major [272f18cb](https://github.com/appsignal/appsignal-ruby/commit/272f18cb0fde6c77fce8b9fa32b4888216e55381))
75
+ - Set the Rails config defaults for `Appsignal.configure` when used in a Rails initializer. Now when using `Appsignal.configure` in a Rails initializer, the Rails env and root path are set on the AppSignal config as default values and do not need to be manually set. (major [378bbc3e](https://github.com/appsignal/appsignal-ruby/commit/378bbc3e0d809f238f6a8a77ee401f73f0b9bd89))
76
+ - Global transaction metadata helpers now work inside the `Appsignal.report_error` and `Appsignal.send_error` callbacks. The transaction yield parameter will continue to work, but we recommend using the global `Appsignal.set_*` and `Appsignal.add_*` helpers.
77
+
78
+ ```ruby
79
+ # Before
80
+ Appsignal.report_error(error) do |transaction|
81
+ transaction.set_namespace("my namespace")
82
+ transaction.set_action("my action")
83
+ transaction.add_tags(:tag_a => "value", :tag_b => "value")
84
+ # etc.
85
+ end
86
+ Appsignal.send_error(error) do |transaction|
87
+ transaction.set_namespace("my namespace")
88
+ transaction.set_action("my action")
89
+ transaction.add_tags(:tag_a => "value", :tag_b => "value")
90
+ # etc.
91
+ end
92
+
93
+ # After
94
+ Appsignal.report_error(error) do
95
+ Appsignal.set_namespace("my namespace")
96
+ Appsignal.set_action("my action")
97
+ Appsignal.add_tags(:tag_a => "value", :tag_b => "value")
98
+ # etc.
99
+ end
100
+ Appsignal.send_error(error) do
101
+ Appsignal.set_namespace("my namespace")
102
+ Appsignal.set_action("my action")
103
+ Appsignal.add_tags(:tag_a => "value", :tag_b => "value")
104
+ # etc.
105
+ end
106
+ ```
107
+
108
+ (major [7ca6ce21](https://github.com/appsignal/appsignal-ruby/commit/7ca6ce215844f43e9d1277dcce18921f2e716158))
109
+ - Include the Rails app config in diagnose report. If AppSignal is configured in a Rails initializer, this config is now included in the diagnose report. (minor [5439d5cb](https://github.com/appsignal/appsignal-ruby/commit/5439d5cbc6661c705da0d1feb08738c933f56939))
110
+ - Include the config options from the loaders config defaults and the `Appsignal.configure` helper in diagnose report. The sources for config option values will include the loaders and `Appsignal.configure` helper in the output and the JSON report sent to our severs, when opted-in. (patch [a7b34110](https://github.com/appsignal/appsignal-ruby/commit/a7b34110ac47e200a6f136c3706e31fe93d37122))
111
+ - Calculate error rate by transactions with an error, not the number of errors on a transaction. This limits the error rate to a maximum of 100%. (patch [da4975cd](https://github.com/appsignal/appsignal-ruby/commit/da4975cd0dda27e3966266f1a686787609fbbcd2))
112
+
113
+ ### Removed
114
+
115
+ - Remove all deprecated components. Please follow [our Ruby gem 4 upgrade guide](https://docs.appsignal.com/ruby/installation/upgrade-from-3-to-4.html) when upgrading to this version to avoid any errors from calling removed components, methods and helpers. (major [f65bee8d](https://github.com/appsignal/appsignal-ruby/commit/f65bee8d508feae4cba88bd938b297e15269726f))
116
+ - Remove the `Appsignal.listen_for_error` helper. Use manual exception handling using `rescue => error` with the `Appsignal.report_error` helper instead. (major [7c232925](https://github.com/appsignal/appsignal-ruby/commit/7c23292568035eace8d04e3fb53e8d4861b671e6))
117
+ - Remove (private) `Appsignal::Transaction::FRONTEND` constant. This was previously used for the built-in front-end integration, but this has been absent since version 3 of the Ruby gem. (major [c12188e7](https://github.com/appsignal/appsignal-ruby/commit/c12188e7cf5f9adccb485a5930f3bdbbe1b6cc58))
118
+ - Remove the `Appsignal.config=` writer. Use the `Appsignal.configure` helper to configure AppSignal. (major [f4fdf91b](https://github.com/appsignal/appsignal-ruby/commit/f4fdf91b5ead5c5221f5dbad6d8c45069ee2dc98))
119
+
120
+ ### Fixed
121
+
122
+ - Fix an issue where, when setting several errors for the same transaction, error causes from a different error would be shown for an error that has no causes. (patch [d54ce8b9](https://github.com/appsignal/appsignal-ruby/commit/d54ce8b947c9316756c4191155e8d255a8e25a8c))
123
+
3
124
  ## 3.13.0
4
125
 
5
126
  _Published on 2024-08-14._
data/Rakefile CHANGED
@@ -20,11 +20,14 @@ VERSION_MANAGERS = {
20
20
  }
21
21
  }.freeze
22
22
 
23
- def build_job(ruby_version, ruby_gem = nil)
23
+ def build_job(ruby_version, ruby_gem: nil, runs_on: DEFAULT_RUNS_ON)
24
+ name = "Ruby #{ruby_version}"
25
+ name = "#{name} - #{ruby_gem}" if ruby_gem
26
+ name = "#{name} (#{runs_on})" if runs_on != DEFAULT_RUNS_ON
24
27
  {
25
- "name" => "Ruby #{ruby_version}#{" - #{ruby_gem}" if ruby_gem}",
28
+ "name" => name,
26
29
  "needs" => "validation",
27
- "runs-on" => "ubuntu-latest",
30
+ "runs-on" => runs_on,
28
31
  "steps" => [
29
32
  {
30
33
  "name" => "Check out repository",
@@ -54,9 +57,10 @@ def build_job(ruby_version, ruby_gem = nil)
54
57
  }
55
58
  end
56
59
 
57
- def build_matrix_key(ruby_version, ruby_gem = nil)
60
+ def build_matrix_key(ruby_version, ruby_gem: nil, runs_on: DEFAULT_RUNS_ON)
58
61
  base = "ruby_#{ruby_version}"
59
62
  base = "#{base}__#{ruby_gem}" if ruby_gem
63
+ base = "#{base}_#{runs_on}"
60
64
  base.downcase.gsub(/\W/, "-")
61
65
  end
62
66
 
@@ -65,6 +69,8 @@ def gems_with_gemfiles
65
69
  end
66
70
 
67
71
  GITHUB_ACTION_WORKFLOW_FILE = ".github/workflows/ci.yml"
72
+ PRIMARY_JOB_GEMSET = "no_dependencies"
73
+ DEFAULT_RUNS_ON = "ubuntu-latest"
68
74
 
69
75
  namespace :build_matrix do
70
76
  namespace :github do
@@ -79,12 +85,12 @@ namespace :build_matrix do
79
85
  gemset_for_ruby(ruby, matrix).each do |ruby_gem|
80
86
  next unless included_for_ruby?(matrix, ruby_gem, ruby)
81
87
 
82
- is_primary_job = ruby_gem["gem"] == "no_dependencies"
88
+ is_primary_job = ruby_gem["gem"] == PRIMARY_JOB_GEMSET
83
89
  job =
84
90
  if is_primary_job
85
91
  build_job(ruby_version)
86
92
  else
87
- build_job(ruby_version, ruby_gem["gem"])
93
+ build_job(ruby_version, :ruby_gem => ruby_gem["gem"])
88
94
  end
89
95
  job["env"] = matrix["env"]
90
96
  .merge("BUNDLE_GEMFILE" => "gemfiles/#{ruby_gem["gem"]}.gemfile")
@@ -105,10 +111,28 @@ namespace :build_matrix do
105
111
  else
106
112
  job["needs"] = build_matrix_key(ruby["ruby"])
107
113
  job["steps"] << test_step
108
- builds[build_matrix_key(ruby["ruby"], ruby_gem["gem"])] = job
114
+ builds[build_matrix_key(ruby["ruby"], :ruby_gem => ruby_gem["gem"])] = job
109
115
  end
110
116
  end
117
+
118
+ # Add build for macOS
119
+ ruby_gem = PRIMARY_JOB_GEMSET
120
+ runs_on = "macos-14"
121
+ job = build_job(ruby_version, :runs_on => runs_on)
122
+ job["env"] = matrix["env"]
123
+ .merge("BUNDLE_GEMFILE" => "gemfiles/#{ruby_gem}.gemfile")
124
+
125
+ job["steps"] << {
126
+ "name" => "Run tests",
127
+ "run" => "./support/bundler_wrapper exec rake test"
128
+ }
129
+ job["steps"] << {
130
+ "name" => "Run tests without extension",
131
+ "run" => "./support/bundler_wrapper exec rake test:failure"
132
+ }
133
+ builds[build_matrix_key(ruby["ruby"], :runs_on => runs_on)] = job
111
134
  end
135
+
112
136
  github["jobs"] = github["jobs"].merge(builds)
113
137
 
114
138
  job_count = github["jobs"].count
data/benchmark.rake CHANGED
@@ -58,11 +58,9 @@ namespace :benchmark do
58
58
  end
59
59
 
60
60
  def start_agent
61
- Appsignal.config = Appsignal::Config.new(
62
- Dir.pwd,
63
- "production",
64
- :endpoint => "http://localhost:8080"
65
- )
61
+ Appsignal.configure(:production) do |config|
62
+ config.endpoint = "http://localhost:8080"
63
+ end
66
64
  Appsignal.start
67
65
  end
68
66
 
@@ -72,7 +70,7 @@ def monitor_transaction(transaction_id)
72
70
  Appsignal::Transaction::HTTP_REQUEST
73
71
  )
74
72
  transaction.set_action("HomeController#show")
75
- transaction.set_params(:id => 1)
73
+ transaction.add_params(:id => 1)
76
74
 
77
75
  Appsignal.instrument("process_action.action_controller") do
78
76
  Appsignal.instrument_sql(
data/build_matrix.yml CHANGED
@@ -84,12 +84,13 @@ matrix:
84
84
  - "rails-6.1"
85
85
  - "rails-7.0"
86
86
  - "rails-7.1"
87
+ - "rails-7.2"
87
88
 
88
89
  ruby:
89
- - ruby: "3.3.1"
90
- - ruby: "3.2.1"
91
- - ruby: "3.1.3"
92
- - ruby: "3.0.5"
90
+ - ruby: "3.3.4"
91
+ - ruby: "3.2.5"
92
+ - ruby: "3.1.6"
93
+ - ruby: "3.0.7"
93
94
  - ruby: "2.7.8"
94
95
  - ruby: "jruby-9.4.7.0"
95
96
  gems: "minimal"
@@ -100,80 +101,85 @@ matrix:
100
101
  - gem: "dry-monitor"
101
102
  only:
102
103
  ruby:
103
- - "3.3.1"
104
- - "3.2.1"
105
- - "3.1.3"
106
- - "3.0.5"
104
+ - "3.3.4"
105
+ - "3.2.5"
106
+ - "3.1.6"
107
+ - "3.0.7"
107
108
  - gem: "grape"
108
109
  - gem: "hanami-2.0"
109
110
  only:
110
111
  ruby:
111
- - "3.3.1"
112
- - "3.2.1"
113
- - "3.1.3"
114
- - "3.0.5"
112
+ - "3.3.4"
113
+ - "3.2.5"
114
+ - "3.1.6"
115
+ - "3.0.7"
115
116
  - gem: "hanami-2.1"
116
117
  only:
117
118
  ruby:
118
- - "3.3.1"
119
- - "3.2.1"
120
- - "3.1.3"
121
- - "3.0.5"
119
+ - "3.3.4"
120
+ - "3.2.5"
121
+ - "3.1.6"
122
+ - "3.0.7"
122
123
  - gem: "http5"
123
124
  - gem: "padrino"
124
125
  - gem: "psych-3"
125
126
  only:
126
127
  ruby:
127
- - "3.3.1"
128
- - "3.2.1"
129
- - "3.1.3"
130
- - "3.0.5"
128
+ - "3.3.4"
129
+ - "3.2.5"
130
+ - "3.1.6"
131
+ - "3.0.7"
131
132
  - "2.7.8"
132
133
  - gem: "psych-4"
133
134
  only:
134
135
  ruby:
135
- - "3.3.1"
136
- - "3.2.1"
137
- - "3.1.3"
138
- - "3.0.5"
136
+ - "3.3.4"
137
+ - "3.2.5"
138
+ - "3.1.6"
139
+ - "3.0.7"
139
140
  - "2.7.8"
140
141
  - gem: "que"
141
- - gem: "que_beta"
142
142
  - gem: "rails-6.0"
143
143
  only:
144
144
  ruby:
145
- - "3.0.5"
145
+ - "3.0.7"
146
146
  - "2.7.8"
147
147
  - "jruby-9.4.7.0"
148
148
  - gem: "rails-6.1"
149
149
  only:
150
150
  ruby:
151
- - "3.3.1"
152
- - "3.2.1"
153
- - "3.1.3"
154
- - "3.0.5"
151
+ - "3.3.4"
152
+ - "3.2.5"
153
+ - "3.1.6"
154
+ - "3.0.7"
155
155
  - "2.7.8"
156
156
  - "jruby-9.4.7.0"
157
157
  - gem: "rails-7.0"
158
158
  only:
159
159
  ruby:
160
- - "3.3.1"
161
- - "3.2.1"
162
- - "3.1.3"
163
- - "3.0.5"
160
+ - "3.3.4"
161
+ - "3.2.5"
162
+ - "3.1.6"
163
+ - "3.0.7"
164
164
  - "2.7.8"
165
165
  - "jruby-9.4.7.0"
166
166
  - gem: "rails-7.1"
167
167
  only:
168
168
  ruby:
169
- - "3.3.1"
170
- - "3.2.1"
171
- - "3.1.3"
172
- - "3.0.5"
169
+ - "3.3.4"
170
+ - "3.2.5"
171
+ - "3.1.6"
172
+ - "3.0.7"
173
+ - "jruby-9.4.7.0"
174
+ - gem: "rails-7.2"
175
+ only:
176
+ ruby:
177
+ - "3.3.4"
178
+ - "3.2.5"
179
+ - "3.1.6"
173
180
  - "jruby-9.4.7.0"
174
181
  - gem: "sequel"
175
182
  - gem: "sinatra"
176
- - gem: "webmachine1"
177
183
  - gem: "webmachine2"
178
184
  - gem: "redis-4"
179
185
  - gem: "redis-5"
data/ext/agent.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # Modifications to this file will be overwritten with the next agent release.
7
7
 
8
8
  APPSIGNAL_AGENT_CONFIG = {
9
- "version" => "0.35.19",
9
+ "version" => "0.35.21",
10
10
  "mirrors" => [
11
11
  "https://appsignal-agent-releases.global.ssl.fastly.net",
12
12
  "https://d135dj0rjqvssy.cloudfront.net"
@@ -14,131 +14,131 @@ APPSIGNAL_AGENT_CONFIG = {
14
14
  "triples" => {
15
15
  "x86_64-darwin" => {
16
16
  "static" => {
17
- "checksum" => "0d465ca77500f7e9675d262a5ccd277fc3428821ac96f973b9941ad49a300ea9",
17
+ "checksum" => "0e7b5bc5bf1e9903276b9fbe105af1128011613f9dc7ac7cedd4d230d92011bd",
18
18
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
19
19
  },
20
20
  "dynamic" => {
21
- "checksum" => "ff1b90c3c52e5b765dc8c43b2c0fe376a06101134ec5879d581642ed6837603e",
21
+ "checksum" => "56cc9aed70014b4fda2b30ff34819370cab2eb2bda588f59d7d86816d60a458f",
22
22
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
23
23
  }
24
24
  },
25
25
  "universal-darwin" => {
26
26
  "static" => {
27
- "checksum" => "0d465ca77500f7e9675d262a5ccd277fc3428821ac96f973b9941ad49a300ea9",
27
+ "checksum" => "0e7b5bc5bf1e9903276b9fbe105af1128011613f9dc7ac7cedd4d230d92011bd",
28
28
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
29
29
  },
30
30
  "dynamic" => {
31
- "checksum" => "ff1b90c3c52e5b765dc8c43b2c0fe376a06101134ec5879d581642ed6837603e",
31
+ "checksum" => "56cc9aed70014b4fda2b30ff34819370cab2eb2bda588f59d7d86816d60a458f",
32
32
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
33
33
  }
34
34
  },
35
35
  "aarch64-darwin" => {
36
36
  "static" => {
37
- "checksum" => "7c735e7490d9d5313e76a0e0508f85983c98caceb0507afa3d8d34bb3b740627",
37
+ "checksum" => "423178f0178f15d7f663451e45a318ca92d8f7cca136b5e985e753520b4ad3e4",
38
38
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
39
39
  },
40
40
  "dynamic" => {
41
- "checksum" => "c29689978f56904771c6caa151a35d8bea3ba4002b6e767ddc102f82d9909fa2",
41
+ "checksum" => "c2c0aeba5ddb38584c8b1cc8b2ad2407431c71b944cd4dee47d45828b93619ae",
42
42
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
43
43
  }
44
44
  },
45
45
  "arm64-darwin" => {
46
46
  "static" => {
47
- "checksum" => "7c735e7490d9d5313e76a0e0508f85983c98caceb0507afa3d8d34bb3b740627",
47
+ "checksum" => "423178f0178f15d7f663451e45a318ca92d8f7cca136b5e985e753520b4ad3e4",
48
48
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
49
49
  },
50
50
  "dynamic" => {
51
- "checksum" => "c29689978f56904771c6caa151a35d8bea3ba4002b6e767ddc102f82d9909fa2",
51
+ "checksum" => "c2c0aeba5ddb38584c8b1cc8b2ad2407431c71b944cd4dee47d45828b93619ae",
52
52
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
53
53
  }
54
54
  },
55
55
  "arm-darwin" => {
56
56
  "static" => {
57
- "checksum" => "7c735e7490d9d5313e76a0e0508f85983c98caceb0507afa3d8d34bb3b740627",
57
+ "checksum" => "423178f0178f15d7f663451e45a318ca92d8f7cca136b5e985e753520b4ad3e4",
58
58
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
59
59
  },
60
60
  "dynamic" => {
61
- "checksum" => "c29689978f56904771c6caa151a35d8bea3ba4002b6e767ddc102f82d9909fa2",
61
+ "checksum" => "c2c0aeba5ddb38584c8b1cc8b2ad2407431c71b944cd4dee47d45828b93619ae",
62
62
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
63
63
  }
64
64
  },
65
65
  "aarch64-linux" => {
66
66
  "static" => {
67
- "checksum" => "6ed44186487547614b1a2d4f1c2fea4676f2b5829c8949ad86ca61a66db716e7",
67
+ "checksum" => "bf94592c9640f89d0321acd5a0a9bd6951154c37f97f4778ddc2fc536203dc4f",
68
68
  "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
69
69
  },
70
70
  "dynamic" => {
71
- "checksum" => "775399b3b559f1c8bd931fb835a88dee012fb62d580584b8e6f4d40ea24f6a0a",
71
+ "checksum" => "8f8e60daae9ac10bae66fcf9ea33984046b5c92d911eae71ac1a8bdbaa7fa3eb",
72
72
  "filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
73
73
  }
74
74
  },
75
75
  "i686-linux" => {
76
76
  "static" => {
77
- "checksum" => "608b8de770ddc9cbc9cae16f793c630079d640b3b77f3af2f854de474e8ef5de",
77
+ "checksum" => "1553674c377a3e6fa56e31754d2af175e734531a44a76c680ff14cc49d4f0031",
78
78
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
79
79
  },
80
80
  "dynamic" => {
81
- "checksum" => "87e893f27ec2128d953c65c46dd0136a0dfab50eab18ec2a3a47cfff8068ca89",
81
+ "checksum" => "93e53b3cb2e2fb89cc3dff690da910fccb46503c3d58e4d3fb1a525fb222eea7",
82
82
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
83
83
  }
84
84
  },
85
85
  "x86-linux" => {
86
86
  "static" => {
87
- "checksum" => "608b8de770ddc9cbc9cae16f793c630079d640b3b77f3af2f854de474e8ef5de",
87
+ "checksum" => "1553674c377a3e6fa56e31754d2af175e734531a44a76c680ff14cc49d4f0031",
88
88
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
89
89
  },
90
90
  "dynamic" => {
91
- "checksum" => "87e893f27ec2128d953c65c46dd0136a0dfab50eab18ec2a3a47cfff8068ca89",
91
+ "checksum" => "93e53b3cb2e2fb89cc3dff690da910fccb46503c3d58e4d3fb1a525fb222eea7",
92
92
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
93
93
  }
94
94
  },
95
95
  "x86_64-linux" => {
96
96
  "static" => {
97
- "checksum" => "4499818ce89075c7754e26c8915b452352a155619f2ce648232fad6480638f34",
97
+ "checksum" => "497d280dff46f7e72875af69f7b3756f3925bcad9e1922f030f818c8c5fa5d67",
98
98
  "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
99
99
  },
100
100
  "dynamic" => {
101
- "checksum" => "70b60e4af4c17c569869293680f5d71ea3c3ab2be8a64dfa02421b431f6a5b7b",
101
+ "checksum" => "1b230cc3e80ef4013defc9d6e80713d1d318ed7f673121433d864b47e239ff73",
102
102
  "filename" => "appsignal-x86_64-linux-all-dynamic.tar.gz"
103
103
  }
104
104
  },
105
105
  "x86_64-linux-musl" => {
106
106
  "static" => {
107
- "checksum" => "ed3a557d8ae6aeb15597ff40dce3739c350053a24d163ddc362af20e7e9d4e1c",
107
+ "checksum" => "2bcbc6b57a0298a97e6549e025ec092f8b3bd2b4e8f430fe7b040f7a2e274527",
108
108
  "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
109
109
  },
110
110
  "dynamic" => {
111
- "checksum" => "594cb5216a260f315481e1c6d56af978716f2736653374c3ea52270a355e673d",
111
+ "checksum" => "7e89c78e9375d55b035f0e75e13d8dd278c2ddf4618fbe005c26f13d249b303f",
112
112
  "filename" => "appsignal-x86_64-linux-musl-all-dynamic.tar.gz"
113
113
  }
114
114
  },
115
115
  "aarch64-linux-musl" => {
116
116
  "static" => {
117
- "checksum" => "f18731c7c549cf635ec8b040c3dbd3cdc3285f0e240c2790a8c8003e0ff7cbee",
117
+ "checksum" => "f9bfd06e0107f3a491ff6009a1e8c0d6d2598c128e8ee84bd852a2f8d3e8e16b",
118
118
  "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
119
119
  },
120
120
  "dynamic" => {
121
- "checksum" => "e7bb93dba7975920539e7d270752c690de9e1e292da5f9b2c0e66863b0c8caf7",
121
+ "checksum" => "187a9a8e58617a0f78077b412dee18351cc975af41500443d7450fc44f2f65d3",
122
122
  "filename" => "appsignal-aarch64-linux-musl-all-dynamic.tar.gz"
123
123
  }
124
124
  },
125
125
  "x86_64-freebsd" => {
126
126
  "static" => {
127
- "checksum" => "fa2c007ca5cb40ac75b7c147d18460edcb0d948648286debc03d4f5afda469f1",
127
+ "checksum" => "cf8043c78e0e628cf0747dd57327d6c0ffd4147d3bff7b2426110fd2fada0960",
128
128
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
129
129
  },
130
130
  "dynamic" => {
131
- "checksum" => "e0e3b59374e7b32eefcc7877a81d0d4d3bcf0d756d7e8cbff3a44444506fa00c",
131
+ "checksum" => "072c2312aadf961c3f851552ee255db77f0c4050e47d438dd9f82e536b68bcd6",
132
132
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
133
133
  }
134
134
  },
135
135
  "amd64-freebsd" => {
136
136
  "static" => {
137
- "checksum" => "fa2c007ca5cb40ac75b7c147d18460edcb0d948648286debc03d4f5afda469f1",
137
+ "checksum" => "cf8043c78e0e628cf0747dd57327d6c0ffd4147d3bff7b2426110fd2fada0960",
138
138
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
139
139
  },
140
140
  "dynamic" => {
141
- "checksum" => "e0e3b59374e7b32eefcc7877a81d0d4d3bcf0d756d7e8cbff3a44444506fa00c",
141
+ "checksum" => "072c2312aadf961c3f851552ee255db77f0c4050e47d438dd9f82e536b68bcd6",
142
142
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
143
143
  }
144
144
  }
@@ -273,6 +273,30 @@ static VALUE finish_transaction(VALUE self, VALUE gc_duration_ms) {
273
273
  return sample == 1 ? Qtrue : Qfalse;
274
274
  }
275
275
 
276
+ static VALUE duplicate_transaction(VALUE self, VALUE new_transaction_id) {
277
+ appsignal_transaction_t* transaction;
278
+ appsignal_transaction_t* duplicate_transaction;
279
+
280
+ Check_Type(new_transaction_id, T_STRING);
281
+ Data_Get_Struct(self, appsignal_transaction_t, transaction);
282
+
283
+ duplicate_transaction = appsignal_duplicate_transaction(
284
+ transaction,
285
+ make_appsignal_string(new_transaction_id)
286
+ );
287
+
288
+ if (duplicate_transaction) {
289
+ return Data_Wrap_Struct(
290
+ Transaction,
291
+ NULL,
292
+ appsignal_free_transaction,
293
+ duplicate_transaction
294
+ );
295
+ } else {
296
+ return Qnil;
297
+ }
298
+ }
299
+
276
300
  static VALUE complete_transaction(VALUE self) {
277
301
  appsignal_transaction_t* transaction;
278
302
 
@@ -858,6 +882,7 @@ void Init_appsignal_extension(void) {
858
882
  rb_define_method(Transaction, "set_queue_start", set_transaction_queue_start, 1);
859
883
  rb_define_method(Transaction, "set_metadata", set_transaction_metadata, 2);
860
884
  rb_define_method(Transaction, "finish", finish_transaction, 1);
885
+ rb_define_method(Transaction, "duplicate", duplicate_transaction, 1);
861
886
  rb_define_method(Transaction, "complete", complete_transaction, 0);
862
887
  rb_define_method(Transaction, "to_json", transaction_to_json, 0);
863
888
 
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 7.2.0"
4
+ gem "rake", "> 12.2"
5
+ gem "sidekiq"
6
+
7
+ # Fix install issue for jruby on gem 3.1.8.
8
+ # No java stub is published.
9
+ gem "bigdecimal", "3.1.7" if RUBY_PLATFORM == "java"
10
+
11
+ gemspec :path => "../"
@@ -10,26 +10,13 @@ module Appsignal
10
10
  "#{Appsignal.config[:logging_endpoint]}/check_ins/json"
11
11
  )
12
12
  end
13
-
14
- def emit_initializer_deprecation_warning
15
- return if @initializer_deprecation_warning_emitted
16
-
17
- callers = caller
18
- Appsignal::Utils::StdoutAndLoggerMessage.warning(
19
- "Passing a `name` keyword argument to `Appsignal::CheckIn::Cron.new` is deprecated. " \
20
- "Please use the `identifier` keyword argument instead, " \
21
- "in the following file and elsewhere, to remove this message.\n#{callers[2]}"
22
- )
23
- @initializer_deprecation_warning_emitted = true
24
- end
25
13
  end
26
14
 
27
15
  # @api private
28
16
  attr_reader :identifier, :digest
29
17
 
30
- def initialize(identifier: nil, name: nil)
31
- @identifier = identifier || name || raise(ArgumentError, "missing keyword: :identifier")
32
- Cron.emit_initializer_deprecation_warning unless name.nil?
18
+ def initialize(identifier:)
19
+ @identifier = identifier
33
20
  @digest = SecureRandom.hex(8)
34
21
  end
35
22