appsignal 2.11.0.beta.3 → 2.11.0.beta.4
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 +5 -0
- data/lib/appsignal/hooks/active_job.rb +12 -6
- data/lib/appsignal/hooks/sidekiq.rb +1 -1
- data/lib/appsignal/integrations/delayed_job_plugin.rb +1 -1
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/hooks/activejob_spec.rb +38 -11
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +3 -14
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +7 -5
- 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: b0817fdd28fcb7bd6bd93f42a4a42939b6059076ba5bb1db77c1d8a6897631e7
|
4
|
+
data.tar.gz: fd9d4818ca5126d282aff16930a1be2a3968da40279a3a6c0ff221719aa1b999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76d76b6a5c32bd596ab975c2b34a5f7a3e4c295fd12da00ee1d03b83cb2654d4a9133f69a278ab617684af78a18d8af789f9609b6e9525cc9a99484c10857627
|
7
|
+
data.tar.gz: c8c1d34eb4484bb847c35ff75e023c73fc08090ff8d17ecb010d985792b440e36e2812d6ef8dd6945bf23e82c6547f75c6fa24ddd296b49332990b267718ae3c
|
data/CHANGELOG.md
CHANGED
@@ -18,6 +18,11 @@
|
|
18
18
|
agents. Commit ba9afb538f44c68b8035a8cf40a39d89bc77b021
|
19
19
|
- Add support for Active Job priority. PR #632
|
20
20
|
- Track Active Job job metrics for magic dashboard. PR #633
|
21
|
+
- Report Sidekiq `jid` (job id) as transaction id, reported as "request_id" on
|
22
|
+
AppSignal.com. PR #640
|
23
|
+
- Always report Active Job ID, an internal ID used by Active Job. PR #639
|
24
|
+
- Support Delayed::Job jobs without specific method name, using
|
25
|
+
`Delayed::Job.enqueue`. PR #642
|
21
26
|
|
22
27
|
# 2.10.9
|
23
28
|
- Use http proxy if configured when downloading agent. PR #606
|
@@ -41,11 +41,7 @@ module Appsignal
|
|
41
41
|
transaction.set_error(exception)
|
42
42
|
raise exception
|
43
43
|
ensure
|
44
|
-
tags =
|
45
|
-
queue = job["queue_name"]
|
46
|
-
tags[:queue] = queue if queue
|
47
|
-
priority = job["priority"]
|
48
|
-
tags[:priority] = priority if priority
|
44
|
+
tags = ActiveJobHelpers.tags_for_job(job)
|
49
45
|
|
50
46
|
if transaction
|
51
47
|
transaction.params =
|
@@ -54,7 +50,8 @@ module Appsignal
|
|
54
50
|
Appsignal.config[:filter_parameters]
|
55
51
|
)
|
56
52
|
|
57
|
-
transaction_tags = tags
|
53
|
+
transaction_tags = tags.dup
|
54
|
+
transaction_tags["active_job_id"] = job["job_id"]
|
58
55
|
provider_job_id = job["provider_job_id"]
|
59
56
|
if provider_job_id
|
60
57
|
transaction_tags[:provider_job_id] = provider_job_id
|
@@ -99,6 +96,15 @@ module Appsignal
|
|
99
96
|
end
|
100
97
|
end
|
101
98
|
|
99
|
+
def self.tags_for_job(job)
|
100
|
+
tags = {}
|
101
|
+
queue = job["queue_name"]
|
102
|
+
tags[:queue] = queue if queue
|
103
|
+
priority = job["priority"]
|
104
|
+
tags[:priority] = priority if priority
|
105
|
+
tags
|
106
|
+
end
|
107
|
+
|
102
108
|
def self.increment_counter(key, value, tags = {})
|
103
109
|
Appsignal.increment_counter "active_job_#{key}", value, tags
|
104
110
|
end
|
@@ -35,7 +35,7 @@ module Appsignal
|
|
35
35
|
def call(_worker, item, _queue)
|
36
36
|
job_status = nil
|
37
37
|
transaction = Appsignal::Transaction.create(
|
38
|
-
|
38
|
+
item["jid"],
|
39
39
|
Appsignal::Transaction::BACKGROUND_JOB,
|
40
40
|
Appsignal::Transaction::GenericRequest.new(
|
41
41
|
:queue_start => item["enqueued_at"]
|
data/lib/appsignal/version.rb
CHANGED
@@ -110,7 +110,10 @@ if DependencyHelper.active_job_present?
|
|
110
110
|
"metadata" => {},
|
111
111
|
"sample_data" => hash_including(
|
112
112
|
"params" => [],
|
113
|
-
"tags" => {
|
113
|
+
"tags" => {
|
114
|
+
"active_job_id" => kind_of(String),
|
115
|
+
"queue" => queue
|
116
|
+
}
|
114
117
|
)
|
115
118
|
)
|
116
119
|
events = transaction_hash["events"]
|
@@ -130,7 +133,7 @@ if DependencyHelper.active_job_present?
|
|
130
133
|
transaction_hash = transaction.to_h
|
131
134
|
expect(transaction_hash).to include(
|
132
135
|
"sample_data" => hash_including(
|
133
|
-
"tags" =>
|
136
|
+
"tags" => hash_including("queue" => "custom_queue")
|
134
137
|
)
|
135
138
|
)
|
136
139
|
end
|
@@ -161,7 +164,7 @@ if DependencyHelper.active_job_present?
|
|
161
164
|
transaction_hash = transaction.to_h
|
162
165
|
expect(transaction_hash).to include(
|
163
166
|
"sample_data" => hash_including(
|
164
|
-
"tags" =>
|
167
|
+
"tags" => hash_including("queue" => queue, "priority" => 10)
|
165
168
|
)
|
166
169
|
)
|
167
170
|
end
|
@@ -194,7 +197,10 @@ if DependencyHelper.active_job_present?
|
|
194
197
|
"metadata" => {},
|
195
198
|
"sample_data" => hash_including(
|
196
199
|
"params" => [],
|
197
|
-
"tags" => {
|
200
|
+
"tags" => {
|
201
|
+
"active_job_id" => kind_of(String),
|
202
|
+
"queue" => queue
|
203
|
+
}
|
198
204
|
)
|
199
205
|
)
|
200
206
|
events = transaction_hash["events"]
|
@@ -227,7 +233,10 @@ if DependencyHelper.active_job_present?
|
|
227
233
|
"metadata" => {},
|
228
234
|
"sample_data" => hash_including(
|
229
235
|
"params" => [],
|
230
|
-
"tags" => {
|
236
|
+
"tags" => {
|
237
|
+
"active_job_id" => kind_of(String),
|
238
|
+
"queue" => queue
|
239
|
+
}
|
231
240
|
)
|
232
241
|
)
|
233
242
|
events = transaction_hash["events"]
|
@@ -363,7 +372,10 @@ if DependencyHelper.active_job_present?
|
|
363
372
|
"action" => "ActionMailerTestJob#welcome",
|
364
373
|
"sample_data" => hash_including(
|
365
374
|
"params" => ["ActionMailerTestJob", "welcome", "deliver_now"],
|
366
|
-
"tags" => {
|
375
|
+
"tags" => {
|
376
|
+
"active_job_id" => kind_of(String),
|
377
|
+
"queue" => "mailers"
|
378
|
+
}
|
367
379
|
)
|
368
380
|
)
|
369
381
|
end
|
@@ -379,7 +391,10 @@ if DependencyHelper.active_job_present?
|
|
379
391
|
"action" => "ActionMailerTestJob#welcome",
|
380
392
|
"sample_data" => hash_including(
|
381
393
|
"params" => ["ActionMailerTestJob", "welcome", "deliver_now"] + method_expected_args,
|
382
|
-
"tags" => {
|
394
|
+
"tags" => {
|
395
|
+
"active_job_id" => kind_of(String),
|
396
|
+
"queue" => "mailers"
|
397
|
+
}
|
383
398
|
)
|
384
399
|
)
|
385
400
|
end
|
@@ -396,7 +411,10 @@ if DependencyHelper.active_job_present?
|
|
396
411
|
"action" => "ActionMailerTestJob#welcome",
|
397
412
|
"sample_data" => hash_including(
|
398
413
|
"params" => ["ActionMailerTestJob", "welcome", "deliver_now", parameterized_expected_args],
|
399
|
-
"tags" => {
|
414
|
+
"tags" => {
|
415
|
+
"active_job_id" => kind_of(String),
|
416
|
+
"queue" => "mailers"
|
417
|
+
}
|
400
418
|
)
|
401
419
|
)
|
402
420
|
end
|
@@ -434,7 +452,10 @@ if DependencyHelper.active_job_present?
|
|
434
452
|
"deliver_now",
|
435
453
|
{ active_job_internal_key => ["args"], "args" => [] }
|
436
454
|
],
|
437
|
-
"tags" => {
|
455
|
+
"tags" => {
|
456
|
+
"active_job_id" => kind_of(String),
|
457
|
+
"queue" => "mailers"
|
458
|
+
}
|
438
459
|
)
|
439
460
|
)
|
440
461
|
end
|
@@ -457,7 +478,10 @@ if DependencyHelper.active_job_present?
|
|
457
478
|
"args" => method_expected_args
|
458
479
|
}
|
459
480
|
],
|
460
|
-
"tags" => {
|
481
|
+
"tags" => {
|
482
|
+
"active_job_id" => kind_of(String),
|
483
|
+
"queue" => "mailers"
|
484
|
+
}
|
461
485
|
)
|
462
486
|
)
|
463
487
|
end
|
@@ -482,7 +506,10 @@ if DependencyHelper.active_job_present?
|
|
482
506
|
"params" => parameterized_expected_args
|
483
507
|
}
|
484
508
|
],
|
485
|
-
"tags" => {
|
509
|
+
"tags" => {
|
510
|
+
"active_job_id" => kind_of(String),
|
511
|
+
"queue" => "mailers"
|
512
|
+
}
|
486
513
|
)
|
487
514
|
)
|
488
515
|
end
|
@@ -227,25 +227,14 @@ describe Appsignal::Hooks::DelayedJobHook do
|
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
230
|
-
context "
|
231
|
-
let(:job_data) do
|
232
|
-
{ :name => "", :payload_object => payload_object }
|
233
|
-
end
|
234
|
-
|
235
|
-
it "wraps it in a transaction using the class method job name" do
|
236
|
-
perform
|
237
|
-
expect(last_transaction.to_h["action"]).to eql("unknown")
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
|
-
context "with invalid job name" do
|
230
|
+
context "with only job class name" do
|
242
231
|
let(:job_data) do
|
243
232
|
{ :name => "Banana", :payload_object => payload_object }
|
244
233
|
end
|
245
234
|
|
246
|
-
it "
|
235
|
+
it "appends #perform to the class name" do
|
247
236
|
perform
|
248
|
-
expect(last_transaction.to_h["action"]).to eql("
|
237
|
+
expect(last_transaction.to_h["action"]).to eql("Banana#perform")
|
249
238
|
end
|
250
239
|
end
|
251
240
|
|
@@ -76,9 +76,10 @@ describe Appsignal::Hooks::SidekiqPlugin, :with_yaml_parse_error => false do
|
|
76
76
|
]
|
77
77
|
end
|
78
78
|
let(:job_class) { "TestClass" }
|
79
|
+
let(:jid) { "b4a577edbccf1d805744efa9" }
|
79
80
|
let(:item) do
|
80
81
|
{
|
81
|
-
"jid" =>
|
82
|
+
"jid" => jid,
|
82
83
|
"class" => job_class,
|
83
84
|
"retry_count" => 0,
|
84
85
|
"queue" => "default",
|
@@ -151,7 +152,7 @@ describe Appsignal::Hooks::SidekiqPlugin, :with_yaml_parse_error => false do
|
|
151
152
|
context "when using the Sidekiq delayed extension" do
|
152
153
|
let(:item) do
|
153
154
|
{
|
154
|
-
"jid" =>
|
155
|
+
"jid" => jid,
|
155
156
|
"class" => "Sidekiq::Extensions::DelayedClass",
|
156
157
|
"queue" => "default",
|
157
158
|
"args" => [
|
@@ -191,7 +192,7 @@ describe Appsignal::Hooks::SidekiqPlugin, :with_yaml_parse_error => false do
|
|
191
192
|
context "when using the Sidekiq ActiveRecord instance delayed extension" do
|
192
193
|
let(:item) do
|
193
194
|
{
|
194
|
-
"jid" =>
|
195
|
+
"jid" => jid,
|
195
196
|
"class" => "Sidekiq::Extensions::DelayedModel",
|
196
197
|
"queue" => "default",
|
197
198
|
"args" => [
|
@@ -243,7 +244,7 @@ describe Appsignal::Hooks::SidekiqPlugin, :with_yaml_parse_error => false do
|
|
243
244
|
|
244
245
|
transaction_hash = transaction.to_h
|
245
246
|
expect(transaction_hash).to include(
|
246
|
-
"id" =>
|
247
|
+
"id" => jid,
|
247
248
|
"action" => "TestClass#perform",
|
248
249
|
"error" => {
|
249
250
|
"name" => "ExampleException",
|
@@ -277,7 +278,7 @@ describe Appsignal::Hooks::SidekiqPlugin, :with_yaml_parse_error => false do
|
|
277
278
|
|
278
279
|
transaction_hash = transaction.to_h
|
279
280
|
expect(transaction_hash).to include(
|
280
|
-
"id" =>
|
281
|
+
"id" => jid,
|
281
282
|
"action" => "TestClass#perform",
|
282
283
|
"error" => nil,
|
283
284
|
"metadata" => {
|
@@ -361,6 +362,7 @@ if DependencyHelper.active_job_present?
|
|
361
362
|
end
|
362
363
|
let(:expected_tags) do
|
363
364
|
{}.tap do |hash|
|
365
|
+
hash["active_job_id"] = kind_of(String)
|
364
366
|
if DependencyHelper.rails_version >= Gem::Version.new("5.0.0")
|
365
367
|
hash["provider_job_id"] = kind_of(String)
|
366
368
|
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: 2.11.0.beta.
|
4
|
+
version: 2.11.0.beta.4
|
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: 2020-07-
|
13
|
+
date: 2020-07-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|