skylight-core 4.0.0.beta → 4.0.0.beta2
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/lib/skylight/core/normalizers/action_controller/process_action.rb +3 -3
- data/lib/skylight/core/normalizers/active_job/perform.rb +14 -1
- data/lib/skylight/core/probes/action_controller.rb +6 -5
- data/lib/skylight/core/probes/action_view.rb +3 -3
- data/lib/skylight/core/probes/active_job_enqueue.rb +7 -2
- data/lib/skylight/core/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: 5667f3a36781897ae62521c5d959f4b840901098bd3fe639b8bbce7751b7339b
|
4
|
+
data.tar.gz: c39fbb604997035cbfdaabafb2a6f9774c744711b41ae2201e34bf8ba6ee82ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4afc3b9e000c00161e196a91936894b15a04adc6edb15760c69dd6adaa44357d1ed397f8dfe59f5105268f68faff22a72fcc1c1e8a0060236adc1141c97c3416
|
7
|
+
data.tar.gz: 23f7bca0c54d9266865ea766798640a6bc4d24815611fcde6dc0e0bd81a05a7710a81ab6e22ef19dd959cbdbef099b8af0c4854ccab4daea96366825369e0c0a
|
@@ -28,10 +28,10 @@ module Skylight::Core
|
|
28
28
|
# Show 'error' if there's an unhandled exception or if the status is 4xx or 5xx
|
29
29
|
if payload[:exception] || payload[:exception_object] || payload[:status].to_s =~ /^[45]/
|
30
30
|
segment = "error"
|
31
|
-
# We won't have a
|
32
|
-
elsif payload[:
|
31
|
+
# We won't have a sk_rendered_format if it's a `head` outside of a `respond_to` block.
|
32
|
+
elsif payload[:sk_rendered_format]
|
33
33
|
# We only show the variant if we actually have a format
|
34
|
-
segment = [payload[:
|
34
|
+
segment = [payload[:sk_rendered_format], payload[:sk_variant]].compact.flatten.join("+")
|
35
35
|
end
|
36
36
|
|
37
37
|
if segment
|
@@ -4,6 +4,17 @@ module Skylight::Core
|
|
4
4
|
class Perform < Normalizer
|
5
5
|
register "perform.active_job"
|
6
6
|
|
7
|
+
DELIVERY_JOB = "ActionMailer::DeliveryJob".freeze
|
8
|
+
|
9
|
+
def self.normalize_title(job_instance)
|
10
|
+
job_instance.class.name.to_s.tap do |str|
|
11
|
+
if str == DELIVERY_JOB
|
12
|
+
mailer_class, mailer_method, * = job_instance.arguments
|
13
|
+
return ["#{mailer_class}##{mailer_method}", str]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
7
18
|
CAT = "app.job.perform".freeze
|
8
19
|
|
9
20
|
def normalize(trace, _name, payload)
|
@@ -49,11 +60,13 @@ module Skylight::Core
|
|
49
60
|
# If the current endpoint name matches this payload, return true to allow the
|
50
61
|
# segment to be assigned by normalize_after.
|
51
62
|
trace.endpoint == Skylight::Core::Probes::ActiveJob::Probe::TITLE ||
|
63
|
+
trace.endpoint == DELIVERY_JOB ||
|
52
64
|
trace.endpoint == normalize_title(payload[:job])
|
53
65
|
end
|
54
66
|
|
55
67
|
def normalize_title(job_instance)
|
56
|
-
|
68
|
+
title, * = self.class.normalize_title(job_instance)
|
69
|
+
title
|
57
70
|
end
|
58
71
|
end
|
59
72
|
end
|
@@ -5,22 +5,23 @@ module Skylight::Core
|
|
5
5
|
def install
|
6
6
|
::ActionController::Instrumentation.class_eval do
|
7
7
|
private
|
8
|
-
|
9
8
|
alias_method :append_info_to_payload_without_sk, :append_info_to_payload
|
10
9
|
def append_info_to_payload(payload)
|
11
10
|
append_info_to_payload_without_sk(payload)
|
11
|
+
|
12
12
|
rendered_mime = begin
|
13
|
-
if respond_to?(:rendered_format)
|
13
|
+
if respond_to?(:rendered_format) && rendered_format
|
14
14
|
rendered_format
|
15
15
|
elsif content_type.is_a?(Mime::Type)
|
16
16
|
content_type
|
17
17
|
elsif content_type.respond_to?(:to_s)
|
18
|
-
type_str = content_type.to_s.split(
|
18
|
+
type_str = content_type.to_s.split(';').first
|
19
19
|
Mime::Type.lookup(type_str) unless type_str.blank?
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
23
|
-
payload[:
|
22
|
+
|
23
|
+
payload[:sk_rendered_format] = rendered_mime.try(:ref)
|
24
|
+
payload[:sk_variant] = request.respond_to?(:variant) ? request.variant : nil
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
@@ -10,9 +10,9 @@ module Skylight::Core
|
|
10
10
|
path, locals = case args.length
|
11
11
|
when 2
|
12
12
|
args
|
13
|
-
when
|
14
|
-
# Rails
|
15
|
-
args
|
13
|
+
when 4
|
14
|
+
# Rails >= 6.0.0.beta2 arguments are (view, path, template, locals)
|
15
|
+
[args[1], args[3]]
|
16
16
|
end
|
17
17
|
|
18
18
|
layout = nil
|
@@ -9,8 +9,13 @@ module Skylight::Core
|
|
9
9
|
begin
|
10
10
|
job_class = job.class
|
11
11
|
adapter_name = EnqueueProbe.normalize_adapter_name(job_class)
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
# If this is an ActionMailer::DeliveryJob, we'll report this as the mailer title
|
14
|
+
# and include ActionMailer::DeliveryJob in the description.
|
15
|
+
name, job_class_name = Skylight::Core::Normalizers::ActiveJob::Perform.normalize_title(job)
|
16
|
+
descriptors = ["adapter: '#{adapter_name}'", "queue: '#{job.queue_name}'"]
|
17
|
+
descriptors << "job: '#{job_class_name}'" if job_class_name
|
18
|
+
desc = "{ #{descriptors.join(', ')} }"
|
14
19
|
rescue
|
15
20
|
block.call
|
16
21
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|