appsignal 4.5.11 → 4.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 023b945dd3db0115fe87951ad7a6008e9f51e22b087d92313cda6f811d96dcfa
4
- data.tar.gz: '0837cd87fbaec97136d0c97a235f988ff119eff3b52a5def3aa28ba7b25c09ec'
3
+ metadata.gz: f462fd8fc28aa3a2a6028261d58ab86697d2b8070ddc1046a6cd28dca037eedf
4
+ data.tar.gz: abfeb2be7e98cad19da981bcc54206fad3a6a07308ed5d4ac0b03043c471b716
5
5
  SHA512:
6
- metadata.gz: 75c2a7ec267f9077fb7c8de88500399f1e47832c94cc97d689c1ffdf615e084ef0dab28ee5c0fb7eee75cb17a87ba1757fab55793cd498b0b6df9b4e58502a58
7
- data.tar.gz: a542100fb83c84ad2e889e80e8ff9b630e443f34ef94c7fc60d2963f571766c6e87e72a21e820b16f8772478d496d4dc2d665cda906b216dcf045d9d8f8668e4
6
+ metadata.gz: 1a55c84c2f35efc21b0e64bbefbd4d6af3141643567629bab715a5133560a23e64f71a9f9f198da006c63cfd4d99ef6ab7f0e95f5ca0ad55f4ff52d74739d54a
7
+ data.tar.gz: 26e857ed78d111e6c504715de0a967992a9c2b16cf22defe5bb388516db882104fe296b93375e77457f60b87c938290f1e010c90f4f2b1a8a881a67964e358cb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 4.5.13
4
+
5
+ _Published on 2025-05-12._
6
+
7
+ ### Fixed
8
+
9
+ - Fix the C extension function definitions. On install, the Ruby gem extension would print warnings or fail to compile. (patch [c93f8e20](https://github.com/appsignal/appsignal-ruby/commit/c93f8e20860168929721f0c2b3e642a02dbde936))
10
+
11
+ ## 4.5.12
12
+
13
+ _Published on 2025-05-12._
14
+
15
+ ### Added
16
+
17
+ - Report the Active Job queue time as the `active_job_queue_time` metric. This metric can be used to track the queue time per Active Job queue. (patch [906f4458](https://github.com/appsignal/appsignal-ruby/commit/906f4458ceab3a922ffb1437e5bc85416589b809))
18
+
3
19
  ## 4.5.11
4
20
 
5
21
  _Published on 2025-05-08._
@@ -838,7 +838,7 @@ static void track_allocation(rb_event_flag_t flag, VALUE arg1, VALUE arg2, ID ar
838
838
  appsignal_track_allocation();
839
839
  }
840
840
 
841
- static VALUE install_allocation_event_hook() {
841
+ static VALUE install_allocation_event_hook(VALUE self) {
842
842
  // This event hook is only available on Ruby 2.1 and 2.2
843
843
  #if defined(RUBY_INTERNAL_EVENT_NEWOBJ)
844
844
  rb_add_event_hook(
@@ -851,7 +851,7 @@ static VALUE install_allocation_event_hook() {
851
851
  return Qnil;
852
852
  }
853
853
 
854
- static VALUE running_in_container() {
854
+ static VALUE running_in_container(VALUE self) {
855
855
  return appsignal_running_in_container() == 1 ? Qtrue : Qfalse;
856
856
  }
857
857
 
@@ -42,7 +42,16 @@ module Appsignal
42
42
  end
43
43
 
44
44
  module ActiveJobClassInstrumentation
45
- def execute(job)
45
+ def execute(job) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
46
+ enqueued_at = job["enqueued_at"]
47
+ queue_start = Time.parse(enqueued_at) if enqueued_at
48
+ queue_time =
49
+ if queue_start
50
+ time_now = Time.now.utc
51
+ # Calculate queue time and store it as milliseconds
52
+ (time_now - queue_start) * 1_000
53
+ end
54
+
46
55
  job_status = nil
47
56
  has_wrapper_transaction = Appsignal::Transaction.current?
48
57
  transaction =
@@ -73,10 +82,8 @@ module Appsignal
73
82
  raise exception
74
83
  ensure
75
84
  if transaction
76
- enqueued_at = job["enqueued_at"]
77
- if enqueued_at # Present in Rails 6 and up
78
- transaction.set_queue_start((Time.parse(enqueued_at).to_f * 1_000).to_i)
79
- end
85
+ # Present in Rails 6 and up
86
+ transaction.set_queue_start((queue_start.to_f * 1_000).to_i) if queue_start
80
87
 
81
88
  unless has_wrapper_transaction
82
89
  # Only complete transaction if ActiveJob is not wrapped in
@@ -94,6 +101,15 @@ module Appsignal
94
101
  ActiveJobHelpers.increment_counter metric_name, 1,
95
102
  tags.merge(:status => :processed)
96
103
  end
104
+
105
+ queue_name = job["queue_name"]
106
+ if queue_time && queue_name
107
+ ActiveJobHelpers.add_distribution_value(
108
+ "queue_time",
109
+ queue_time,
110
+ :queue => queue_name
111
+ )
112
+ end
97
113
  end
98
114
 
99
115
  private
@@ -172,6 +188,10 @@ module Appsignal
172
188
  def self.increment_counter(key, value, tags = {})
173
189
  Appsignal.increment_counter "active_job_#{key}", value, tags
174
190
  end
191
+
192
+ def self.add_distribution_value(key, value, tags = {})
193
+ Appsignal.add_distribution_value("active_job_#{key}", value, tags)
194
+ end
175
195
  end
176
196
  end
177
197
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "4.5.11"
4
+ VERSION = "4.5.13"
5
5
  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: 4.5.11
4
+ version: 4.5.13
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: 2025-05-08 00:00:00.000000000 Z
13
+ date: 2025-05-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: logger
@@ -317,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
317
  - !ruby/object:Gem::Version
318
318
  version: '0'
319
319
  requirements: []
320
- rubygems_version: 3.3.7
320
+ rubygems_version: 3.5.23
321
321
  signing_key:
322
322
  specification_version: 4
323
323
  summary: Logs performance and exception data from your app to appsignal.com