appsignal 4.5.9 → 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 +4 -4
- data/CHANGELOG.md +32 -0
- data/README.md +0 -3
- data/build_matrix.yml +13 -0
- data/ext/agent.rb +27 -27
- data/ext/appsignal_extension.c +2 -2
- data/lib/appsignal/check_in/event.rb +55 -0
- data/lib/appsignal/check_in/scheduler.rb +3 -1
- data/lib/appsignal/hooks/active_job.rb +25 -5
- data/lib/appsignal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f462fd8fc28aa3a2a6028261d58ab86697d2b8070ddc1046a6cd28dca037eedf
|
4
|
+
data.tar.gz: abfeb2be7e98cad19da981bcc54206fad3a6a07308ed5d4ac0b03043c471b716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a55c84c2f35efc21b0e64bbefbd4d6af3141643567629bab715a5133560a23e64f71a9f9f198da006c63cfd4d99ef6ab7f0e95f5ca0ad55f4ff52d74739d54a
|
7
|
+
data.tar.gz: 26e857ed78d111e6c504715de0a967992a9c2b16cf22defe5bb388516db882104fe296b93375e77457f60b87c938290f1e010c90f4f2b1a8a881a67964e358cb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,37 @@
|
|
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
|
+
|
19
|
+
## 4.5.11
|
20
|
+
|
21
|
+
_Published on 2025-05-08._
|
22
|
+
|
23
|
+
### Changed
|
24
|
+
|
25
|
+
- Log a debug message when the reported error is ignored by the `ignore_errors` config option. (patch [0cda9da0](https://github.com/appsignal/appsignal-ruby/commit/0cda9da0c47c56bee39b6e045be36655dd13ee54))
|
26
|
+
|
27
|
+
## 4.5.10
|
28
|
+
|
29
|
+
_Published on 2025-05-05._
|
30
|
+
|
31
|
+
### Changed
|
32
|
+
|
33
|
+
- Remove redundant cron check-in pairs. When more than one pair of start and finish cron check-in events is reported for the same identifier in the same period, only one of them will be reported to AppSignal. (patch [803a0389](https://github.com/appsignal/appsignal-ruby/commit/803a03893aaf83391129b0b30cda169c8922a870))
|
34
|
+
|
3
35
|
## 4.5.9
|
4
36
|
|
5
37
|
_Published on 2025-04-09._
|
data/README.md
CHANGED
@@ -9,9 +9,6 @@ issues.
|
|
9
9
|
- [Ruby code documentation][ruby-doc]
|
10
10
|
- [Support][contact]
|
11
11
|
|
12
|
-
[](http://badge.fury.io/rb/appsignal)
|
13
|
-
[](https://codeclimate.com/github/appsignal/appsignal)
|
14
|
-
|
15
12
|
## Description
|
16
13
|
|
17
14
|
The AppSignal gem collects exceptions and performance data from your Ruby
|
data/build_matrix.yml
CHANGED
@@ -88,6 +88,7 @@ matrix:
|
|
88
88
|
- "rails-8.0"
|
89
89
|
|
90
90
|
ruby:
|
91
|
+
- ruby: "3.5.0-preview1"
|
91
92
|
- ruby: "3.4.1"
|
92
93
|
- ruby: "3.3.4"
|
93
94
|
- ruby: "3.2.5"
|
@@ -103,6 +104,7 @@ matrix:
|
|
103
104
|
- gem: "dry-monitor"
|
104
105
|
only:
|
105
106
|
ruby:
|
107
|
+
- "3.5.0-preview1"
|
106
108
|
- "3.4.1"
|
107
109
|
- "3.3.4"
|
108
110
|
- "3.2.5"
|
@@ -112,6 +114,7 @@ matrix:
|
|
112
114
|
- gem: "hanami-2.0"
|
113
115
|
only:
|
114
116
|
ruby:
|
117
|
+
- "3.5.0-preview1"
|
115
118
|
- "3.4.1"
|
116
119
|
- "3.3.4"
|
117
120
|
- "3.2.5"
|
@@ -120,6 +123,7 @@ matrix:
|
|
120
123
|
- gem: "hanami-2.1"
|
121
124
|
only:
|
122
125
|
ruby:
|
126
|
+
- "3.5.0-preview1"
|
123
127
|
- "3.4.1"
|
124
128
|
- "3.3.4"
|
125
129
|
- "3.2.5"
|
@@ -128,6 +132,7 @@ matrix:
|
|
128
132
|
- gem: "hanami-2.2"
|
129
133
|
only:
|
130
134
|
ruby:
|
135
|
+
- "3.5.0-preview1"
|
131
136
|
- "3.4.1"
|
132
137
|
- "3.3.4"
|
133
138
|
- "3.2.5"
|
@@ -138,6 +143,7 @@ matrix:
|
|
138
143
|
- gem: "psych-3"
|
139
144
|
only:
|
140
145
|
ruby:
|
146
|
+
- "3.5.0-preview1"
|
141
147
|
- "3.4.1"
|
142
148
|
- "3.3.4"
|
143
149
|
- "3.2.5"
|
@@ -147,6 +153,7 @@ matrix:
|
|
147
153
|
- gem: "psych-4"
|
148
154
|
only:
|
149
155
|
ruby:
|
156
|
+
- "3.5.0-preview1"
|
150
157
|
- "3.4.1"
|
151
158
|
- "3.3.4"
|
152
159
|
- "3.2.5"
|
@@ -173,6 +180,7 @@ matrix:
|
|
173
180
|
- gem: "rails-7.0"
|
174
181
|
only:
|
175
182
|
ruby:
|
183
|
+
- "3.5.0-preview1"
|
176
184
|
- "3.4.1"
|
177
185
|
- "3.3.4"
|
178
186
|
- "3.2.5"
|
@@ -183,6 +191,7 @@ matrix:
|
|
183
191
|
- gem: "rails-7.1"
|
184
192
|
only:
|
185
193
|
ruby:
|
194
|
+
- "3.5.0-preview1"
|
186
195
|
- "3.4.1"
|
187
196
|
- "3.3.4"
|
188
197
|
- "3.2.5"
|
@@ -192,6 +201,7 @@ matrix:
|
|
192
201
|
- gem: "rails-7.2"
|
193
202
|
only:
|
194
203
|
ruby:
|
204
|
+
- "3.5.0-preview1"
|
195
205
|
- "3.4.1"
|
196
206
|
- "3.3.4"
|
197
207
|
- "3.2.5"
|
@@ -200,6 +210,7 @@ matrix:
|
|
200
210
|
- gem: "rails-8.0"
|
201
211
|
only:
|
202
212
|
ruby:
|
213
|
+
- "3.5.0-preview1"
|
203
214
|
- "3.4.1"
|
204
215
|
- "3.3.4"
|
205
216
|
- "3.2.5"
|
@@ -211,8 +222,10 @@ matrix:
|
|
211
222
|
- gem: "sidekiq-7"
|
212
223
|
only:
|
213
224
|
ruby:
|
225
|
+
- "3.5.0-preview1"
|
214
226
|
- "3.4.1"
|
215
227
|
- gem: "sidekiq-8"
|
216
228
|
only:
|
217
229
|
ruby:
|
230
|
+
- "3.5.0-preview1"
|
218
231
|
- "3.4.1"
|
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.36.
|
9
|
+
"version" => "0.36.5",
|
10
10
|
"mirrors" => [
|
11
11
|
"https://d135dj0rjqvssy.cloudfront.net",
|
12
12
|
"https://appsignal-agent-releases.global.ssl.fastly.net"
|
@@ -14,131 +14,131 @@ APPSIGNAL_AGENT_CONFIG = {
|
|
14
14
|
"triples" => {
|
15
15
|
"x86_64-darwin" => {
|
16
16
|
"static" => {
|
17
|
-
"checksum" => "
|
17
|
+
"checksum" => "174222cc211a50eefa35f1b2391f94ea1a0fede07ab4210f90764ea4353e24f7",
|
18
18
|
"filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
|
19
19
|
},
|
20
20
|
"dynamic" => {
|
21
|
-
"checksum" => "
|
21
|
+
"checksum" => "5057e7e99d033765bc49e949f2c313299430cdcdce257d2ee2e7f0565be38776",
|
22
22
|
"filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
|
23
23
|
}
|
24
24
|
},
|
25
25
|
"universal-darwin" => {
|
26
26
|
"static" => {
|
27
|
-
"checksum" => "
|
27
|
+
"checksum" => "174222cc211a50eefa35f1b2391f94ea1a0fede07ab4210f90764ea4353e24f7",
|
28
28
|
"filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
|
29
29
|
},
|
30
30
|
"dynamic" => {
|
31
|
-
"checksum" => "
|
31
|
+
"checksum" => "5057e7e99d033765bc49e949f2c313299430cdcdce257d2ee2e7f0565be38776",
|
32
32
|
"filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
|
33
33
|
}
|
34
34
|
},
|
35
35
|
"aarch64-darwin" => {
|
36
36
|
"static" => {
|
37
|
-
"checksum" => "
|
37
|
+
"checksum" => "54d9687a716c5e607f92aa93782b1c64fe064d4a42c58473e0b07eb313378103",
|
38
38
|
"filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
|
39
39
|
},
|
40
40
|
"dynamic" => {
|
41
|
-
"checksum" => "
|
41
|
+
"checksum" => "3b6e420e306856c3d35fefb3a1e0b57cbc4623732a661517ccb75ab0657b5aa5",
|
42
42
|
"filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
|
43
43
|
}
|
44
44
|
},
|
45
45
|
"arm64-darwin" => {
|
46
46
|
"static" => {
|
47
|
-
"checksum" => "
|
47
|
+
"checksum" => "54d9687a716c5e607f92aa93782b1c64fe064d4a42c58473e0b07eb313378103",
|
48
48
|
"filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
|
49
49
|
},
|
50
50
|
"dynamic" => {
|
51
|
-
"checksum" => "
|
51
|
+
"checksum" => "3b6e420e306856c3d35fefb3a1e0b57cbc4623732a661517ccb75ab0657b5aa5",
|
52
52
|
"filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
|
53
53
|
}
|
54
54
|
},
|
55
55
|
"arm-darwin" => {
|
56
56
|
"static" => {
|
57
|
-
"checksum" => "
|
57
|
+
"checksum" => "54d9687a716c5e607f92aa93782b1c64fe064d4a42c58473e0b07eb313378103",
|
58
58
|
"filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
|
59
59
|
},
|
60
60
|
"dynamic" => {
|
61
|
-
"checksum" => "
|
61
|
+
"checksum" => "3b6e420e306856c3d35fefb3a1e0b57cbc4623732a661517ccb75ab0657b5aa5",
|
62
62
|
"filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
|
63
63
|
}
|
64
64
|
},
|
65
65
|
"aarch64-linux" => {
|
66
66
|
"static" => {
|
67
|
-
"checksum" => "
|
67
|
+
"checksum" => "59746a7fe722eb9c985e155aeaefdab37d96a96f650eff81b8610955b09edebb",
|
68
68
|
"filename" => "appsignal-aarch64-linux-all-static.tar.gz"
|
69
69
|
},
|
70
70
|
"dynamic" => {
|
71
|
-
"checksum" => "
|
71
|
+
"checksum" => "6a8c597ed646790c6a70913a8be70e2cc7cc022a3ffedf7b1df6e003b1781aea",
|
72
72
|
"filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
|
73
73
|
}
|
74
74
|
},
|
75
75
|
"i686-linux" => {
|
76
76
|
"static" => {
|
77
|
-
"checksum" => "
|
77
|
+
"checksum" => "4202807069dcd2b9df2c478273f7ce23f88e47224e75a5062592ed6af8a675ec",
|
78
78
|
"filename" => "appsignal-i686-linux-all-static.tar.gz"
|
79
79
|
},
|
80
80
|
"dynamic" => {
|
81
|
-
"checksum" => "
|
81
|
+
"checksum" => "34a6b6502eb924c60fe98a4c0d62fc83b8ca210beb334c559f909cad24276312",
|
82
82
|
"filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"x86-linux" => {
|
86
86
|
"static" => {
|
87
|
-
"checksum" => "
|
87
|
+
"checksum" => "4202807069dcd2b9df2c478273f7ce23f88e47224e75a5062592ed6af8a675ec",
|
88
88
|
"filename" => "appsignal-i686-linux-all-static.tar.gz"
|
89
89
|
},
|
90
90
|
"dynamic" => {
|
91
|
-
"checksum" => "
|
91
|
+
"checksum" => "34a6b6502eb924c60fe98a4c0d62fc83b8ca210beb334c559f909cad24276312",
|
92
92
|
"filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
|
93
93
|
}
|
94
94
|
},
|
95
95
|
"x86_64-linux" => {
|
96
96
|
"static" => {
|
97
|
-
"checksum" => "
|
97
|
+
"checksum" => "948ae7a80b5c33807ddfd7f7e575515db76868dc4750993e658a19920db43d99",
|
98
98
|
"filename" => "appsignal-x86_64-linux-all-static.tar.gz"
|
99
99
|
},
|
100
100
|
"dynamic" => {
|
101
|
-
"checksum" => "
|
101
|
+
"checksum" => "bdc95b8c5da28802c4023eb48d30aa7f8c4ec85484436d083f43fea0087c946e",
|
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" => "
|
107
|
+
"checksum" => "e9d717aecfe1a7bcc139289b8aa10d3e4e52f487776cd1a26025ac13b55b7754",
|
108
108
|
"filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
|
109
109
|
},
|
110
110
|
"dynamic" => {
|
111
|
-
"checksum" => "
|
111
|
+
"checksum" => "bef8053e0bf3cc35f21e448360ae3f0e63a3be82e44473fcdf15022f0d7536c4",
|
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" => "
|
117
|
+
"checksum" => "313affebfe45a3d31a368e39cb3f1ea3860de21282c52ad97c0d194a9dbd52e8",
|
118
118
|
"filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
|
119
119
|
},
|
120
120
|
"dynamic" => {
|
121
|
-
"checksum" => "
|
121
|
+
"checksum" => "8f36aea4e175b60627172521ef40eda5f52bc995b52ac2a23b30cf93d59052c4",
|
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" => "
|
127
|
+
"checksum" => "b35d43501b22bf9a98fc37545932fe79c4adee3cea7c4b5a677266a858ceab88",
|
128
128
|
"filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
|
129
129
|
},
|
130
130
|
"dynamic" => {
|
131
|
-
"checksum" => "
|
131
|
+
"checksum" => "ce0d483848b5d44a5a1dfa5f9bc7d9299d9c7c9c5e5a9e1f0b7b5793a01aa349",
|
132
132
|
"filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
|
133
133
|
}
|
134
134
|
},
|
135
135
|
"amd64-freebsd" => {
|
136
136
|
"static" => {
|
137
|
-
"checksum" => "
|
137
|
+
"checksum" => "b35d43501b22bf9a98fc37545932fe79c4adee3cea7c4b5a677266a858ceab88",
|
138
138
|
"filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
|
139
139
|
},
|
140
140
|
"dynamic" => {
|
141
|
-
"checksum" => "
|
141
|
+
"checksum" => "ce0d483848b5d44a5a1dfa5f9bc7d9299d9c7c9c5e5a9e1f0b7b5793a01aa349",
|
142
142
|
"filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
|
143
143
|
}
|
144
144
|
}
|
data/ext/appsignal_extension.c
CHANGED
@@ -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
|
|
@@ -66,6 +66,61 @@ module Appsignal
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
69
|
+
|
70
|
+
def deduplicate_cron!(events) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
71
|
+
# Remove redundant cron check-in events from the given list of events.
|
72
|
+
# This is done by removing redundant *pairs* of events -- that is,
|
73
|
+
# for each identifier, only send one complete pair of start and
|
74
|
+
# finish events. Remove all other complete pairs of start and finish
|
75
|
+
# events for that identifier, but keep any other start or finish events
|
76
|
+
# that don't have a matching pair.
|
77
|
+
#
|
78
|
+
# Note that this method assumes that the events in this list have already
|
79
|
+
# been rejected based on `Event.redundant?`, so we don't check to remove
|
80
|
+
# check-in events that are functionally identical.
|
81
|
+
start_digests = Hash.new { |h, k| h[k] = Set.new }
|
82
|
+
finish_digests = Hash.new { |h, k| h[k] = Set.new }
|
83
|
+
complete_digests = Hash.new { |h, k| h[k] = Set.new }
|
84
|
+
keep_digest = {}
|
85
|
+
|
86
|
+
# Compute a list of complete digests for each identifier, that is, digests
|
87
|
+
# for which both a start and finish cron check-in event exist. Store the
|
88
|
+
# last seen digest for each identifier as the one to keep.
|
89
|
+
events.each do |event|
|
90
|
+
if event[:check_in_type] == "cron"
|
91
|
+
if event[:kind] == "start"
|
92
|
+
start_digests[event[:identifier]] << event[:digest]
|
93
|
+
if finish_digests[event[:identifier]].include?(event[:digest])
|
94
|
+
complete_digests[event[:identifier]] << event[:digest]
|
95
|
+
keep_digest[event[:identifier]] = event[:digest]
|
96
|
+
end
|
97
|
+
elsif event[:kind] == "finish"
|
98
|
+
finish_digests[event[:identifier]] << event[:digest]
|
99
|
+
if start_digests[event[:identifier]].include?(event[:digest])
|
100
|
+
complete_digests[event[:identifier]] << event[:digest]
|
101
|
+
keep_digest[event[:identifier]] = event[:digest]
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
start_digests = nil
|
108
|
+
finish_digests = nil
|
109
|
+
|
110
|
+
events.reject! do |event|
|
111
|
+
# Do not remove events that are not cron check-in events or that
|
112
|
+
# have an unknown kind.
|
113
|
+
return false unless
|
114
|
+
event[:check_in_type] == "cron" && (
|
115
|
+
event[:kind] == "start" ||
|
116
|
+
event[:kind] == "finish")
|
117
|
+
|
118
|
+
# Remove any event that is part of a complete digest pair, except
|
119
|
+
# for the one digest that should be kept.
|
120
|
+
keep_digest[event[:identifier]] != event[:digest] &&
|
121
|
+
complete_digests[event[:identifier]].include?(event[:digest])
|
122
|
+
end
|
123
|
+
end
|
69
124
|
end
|
70
125
|
end
|
71
126
|
end
|
@@ -161,7 +161,9 @@ module Appsignal
|
|
161
161
|
# Push a copy of the events to the queue, and clear the events array.
|
162
162
|
# This ensures that `@events` always contains events that have not
|
163
163
|
# yet been pushed to the queue.
|
164
|
-
@
|
164
|
+
events = @events.dup
|
165
|
+
Event.deduplicate_cron!(events)
|
166
|
+
@queue.push(events)
|
165
167
|
@events.clear
|
166
168
|
|
167
169
|
start_waker(BETWEEN_TRANSMISSIONS_DEBOUNCE_SECONDS)
|
@@ -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
|
-
|
77
|
-
|
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
|
data/lib/appsignal/version.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: 4.5.
|
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-
|
13
|
+
date: 2025-05-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: logger
|