skylight 5.2.0.beta → 5.2.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/CHANGELOG.md +6 -0
- data/ERRORS.md +3 -0
- data/ext/libskylight.yml +8 -10
- data/lib/skylight/config.rb +4 -0
- data/lib/skylight/data/cacert.pem +730 -1023
- data/lib/skylight/errors.rb +3 -0
- data/lib/skylight/extensions/source_location.rb +2 -2
- data/lib/skylight/normalizers/active_job/perform.rb +22 -25
- data/lib/skylight/util/clock.rb +1 -1
- data/lib/skylight/version.rb +1 -1
- metadata +5 -5
data/lib/skylight/errors.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "skylight/util/lru_cache"
|
4
|
-
require "active_support/
|
4
|
+
require "active_support/inflector"
|
5
5
|
|
6
6
|
module Skylight
|
7
7
|
module Extensions
|
@@ -163,7 +163,7 @@ module Skylight
|
|
163
163
|
|
164
164
|
def instance_method_source_location(constant_name, method_name, source_name: :instance_method)
|
165
165
|
@instance_method_source_location_cache.fetch([constant_name, method_name, source_name]) do
|
166
|
-
if (constant = ::ActiveSupport::
|
166
|
+
if (constant = ::ActiveSupport::Inflector.safe_constantize(constant_name))
|
167
167
|
if constant.instance_methods.include?(:"before_instrument_#{method_name}")
|
168
168
|
method_name = :"before_instrument_#{method_name}"
|
169
169
|
end
|
@@ -15,7 +15,7 @@ module Skylight
|
|
15
15
|
.tap do |str|
|
16
16
|
if str.match(DELIVERY_JOB)
|
17
17
|
mailer_class, mailer_method, * = job_instance.arguments
|
18
|
-
return "#{mailer_class}##{mailer_method}", str
|
18
|
+
return "#{mailer_class}##{mailer_method}", str if mailer_class && mailer_method
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -33,9 +33,7 @@ module Skylight
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def normalize_after(trace, _span, _name, payload)
|
36
|
-
|
37
|
-
|
38
|
-
trace.segment = payload[:job].queue_name
|
36
|
+
maybe_set_endpoint(trace, payload)
|
39
37
|
end
|
40
38
|
|
41
39
|
private
|
@@ -53,31 +51,30 @@ module Skylight
|
|
53
51
|
end
|
54
52
|
|
55
53
|
def maybe_set_endpoint(trace, payload)
|
56
|
-
|
57
|
-
end
|
54
|
+
endpoint = normalize_title(payload[:job])
|
58
55
|
|
59
|
-
def assign_endpoint?(trace, payload)
|
60
56
|
# Always assign the endpoint if it has not yet been assigned by the ActiveJob probe.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
if !trace.endpoint ||
|
58
|
+
(defined?(Skylight::Probes::ActiveJob::TITLE) && trace.endpoint == Skylight::Probes::ActiveJob::TITLE) ||
|
59
|
+
(
|
60
|
+
defined?(Skylight::Probes::DelayedJob::Probe::UNKNOWN) &&
|
61
|
+
trace.endpoint == Skylight::Probes::DelayedJob::Probe::UNKNOWN
|
62
|
+
) ||
|
63
|
+
# If a job is called using #perform_now inside a controller action
|
64
|
+
# or within another job's #perform method, we do not want this to
|
65
|
+
# overwrite the existing endpoint name (unless it is the default from ActiveJob).
|
66
|
+
#
|
67
|
+
# If the current endpoint name matches this payload, return true to allow the
|
68
|
+
# segment to be assigned by normalize_after.
|
69
|
+
trace.endpoint =~ DELIVERY_JOB ||
|
70
|
+
# This adapter wrapper needs to be handled specifically due to interactions with the
|
71
|
+
# standalone Delayed::Job probe, as there is no consistent way to get the wrapped
|
72
|
+
# job name among all Delayed::Job backends.
|
73
|
+
trace.endpoint == DELAYED_JOB_WRAPPER
|
74
|
+
trace.endpoint = endpoint
|
68
75
|
end
|
69
76
|
|
70
|
-
|
71
|
-
# or within another job's #perform method, we do not want this to
|
72
|
-
# overwrite the existing endpoint name (unless it is the default from ActiveJob).
|
73
|
-
#
|
74
|
-
# If the current endpoint name matches this payload, return true to allow the
|
75
|
-
# segment to be assigned by normalize_after.
|
76
|
-
trace.endpoint == DELIVERY_JOB || trace.endpoint == normalize_title(payload[:job]) ||
|
77
|
-
# This adapter wrapper needs to be handled specifically due to interactions with the
|
78
|
-
# standalone Delayed::Job probe, as there is no consistent way to get the wrapped
|
79
|
-
# job name among all Delayed::Job backends.
|
80
|
-
trace.endpoint == DELAYED_JOB_WRAPPER
|
77
|
+
trace.segment = payload[:job].queue_name if trace.endpoint == endpoint && config.enable_segments?
|
81
78
|
end
|
82
79
|
|
83
80
|
def normalize_title(job_instance)
|
data/lib/skylight/util/clock.rb
CHANGED
data/lib/skylight/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.0.
|
4
|
+
version: 5.2.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: 2021-
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.21.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.21.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: simplecov
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -383,7 +383,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
383
383
|
- !ruby/object:Gem::Version
|
384
384
|
version: 1.3.1
|
385
385
|
requirements: []
|
386
|
-
rubygems_version: 3.
|
386
|
+
rubygems_version: 3.0.8
|
387
387
|
signing_key:
|
388
388
|
specification_version: 4
|
389
389
|
summary: Skylight is a smart profiler for Rails, Sinatra, and other Ruby apps.
|