rails-instrumentation 0.1.0 → 0.1.5
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/.gitignore +1 -0
- data/Appraisals +8 -0
- data/lib/rails/instrumentation/patch.rb +2 -4
- data/lib/rails/instrumentation/subscriber.rb +4 -0
- data/lib/rails/instrumentation/subscribers/action_cable_subscriber.rb +14 -10
- data/lib/rails/instrumentation/subscribers/action_controller_subscriber.rb +41 -27
- data/lib/rails/instrumentation/subscribers/action_mailer_subscriber.rb +10 -6
- data/lib/rails/instrumentation/subscribers/action_view_subscriber.rb +10 -6
- data/lib/rails/instrumentation/subscribers/active_job_subscriber.rb +12 -8
- data/lib/rails/instrumentation/subscribers/active_record_subscriber.rb +11 -5
- data/lib/rails/instrumentation/subscribers/active_storage_subscriber.rb +18 -14
- data/lib/rails/instrumentation/subscribers/active_support_subscriber.rb +16 -12
- data/lib/rails/instrumentation/utils.rb +1 -1
- data/lib/rails/instrumentation/version.rb +1 -1
- data/rails-instrumentation.gemspec +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c7a110fc7c8a823c81d77c1895829f9d9f55a162b68f87cc745647e0f0213c4
|
4
|
+
data.tar.gz: 902e1fed1464ef3cab7f912488e52076813ad26d0a60ebd9e3f0a24394d6e6cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4618da4d9e430cb32683f55ad7668bb6626f2b4ed60fc58af81b08441e77f8a2ab01275fd1cf07b5e903dafbd3c754a1ff26e471c20f3f1aa3f54b1751bbb402
|
7
|
+
data.tar.gz: 6d99576f07843c873d5fd18ece9d194757870429a0477fe8b23e90f8689dd1839a43f774b6b765a3cc009616b13dbeebd85e1ea8e76438335b2971b511a71a2e
|
data/.gitignore
CHANGED
data/Appraisals
CHANGED
@@ -6,10 +6,9 @@ module Rails
|
|
6
6
|
alias_method :process_action_original, :process_action
|
7
7
|
|
8
8
|
def process_action(method_name, *args)
|
9
|
-
# this naming scheme 'method
|
9
|
+
# this naming scheme 'class.method' is how we ensure that the notification in the
|
10
10
|
# subscriber is the same one
|
11
|
-
name = "#{
|
12
|
-
puts ::Rails::Instrumentation.tracer
|
11
|
+
name = "#{self.class.name}.#{method_name}"
|
13
12
|
scope = ::Rails::Instrumentation.tracer.start_active_span(name)
|
14
13
|
|
15
14
|
# skip adding tags here. Getting the complete set of information is
|
@@ -30,7 +29,6 @@ module Rails
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def self.restore_process_action(klass: ::ActionController::Instrumentation)
|
33
|
-
puts klass.respond_to? :process_action_original, true
|
34
32
|
klass.class_eval do
|
35
33
|
remove_method :process_action
|
36
34
|
alias_method :process_action, :process_action_original
|
@@ -13,49 +13,53 @@ module Rails
|
|
13
13
|
broadcast
|
14
14
|
].freeze
|
15
15
|
|
16
|
+
# rubocop:disable Style/MutableConstant
|
17
|
+
BASE_TAGS = { 'component' => 'ActionCable' }
|
18
|
+
# rubocop:enable Style/MutableConstant.
|
19
|
+
|
16
20
|
class << self
|
17
21
|
def perform_action(event)
|
18
|
-
tags =
|
22
|
+
tags = span_tags(
|
19
23
|
'channel_class' => event.payload[:channel_class],
|
20
24
|
'action' => event.payload[:action],
|
21
25
|
'data' => event.payload[:data]
|
22
|
-
|
26
|
+
)
|
23
27
|
|
24
28
|
Utils.trace_notification(event: event, tags: tags)
|
25
29
|
end
|
26
30
|
|
27
31
|
def transmit(event)
|
28
|
-
tags =
|
32
|
+
tags = span_tags(
|
29
33
|
'channel_class' => event.payload[:channel_class],
|
30
34
|
'data' => event.payload[:data],
|
31
35
|
'via' => event.payload[:via]
|
32
|
-
|
36
|
+
)
|
33
37
|
|
34
38
|
Utils.trace_notification(event: event, tags: tags)
|
35
39
|
end
|
36
40
|
|
37
41
|
def transmit_subscription_confirmation(event)
|
38
|
-
tags =
|
42
|
+
tags = span_tags(
|
39
43
|
'channel_class' => event.payload[:channel_class]
|
40
|
-
|
44
|
+
)
|
41
45
|
|
42
46
|
Utils.trace_notification(event: event, tags: tags)
|
43
47
|
end
|
44
48
|
|
45
49
|
def transmit_subscription_rejection(event)
|
46
|
-
tags =
|
50
|
+
tags = span_tags(
|
47
51
|
'channel_class' => event.payload[:channel_class]
|
48
|
-
|
52
|
+
)
|
49
53
|
|
50
54
|
Utils.trace_notification(event: event, tags: tags)
|
51
55
|
end
|
52
56
|
|
53
57
|
def broadcast(event)
|
54
|
-
tags =
|
58
|
+
tags = span_tags(
|
55
59
|
'broadcasting' => event.payload[:broadcasting],
|
56
60
|
'message' => event.payload[:message],
|
57
61
|
'coder' => event.payload[:coder]
|
58
|
-
|
62
|
+
)
|
59
63
|
|
60
64
|
Utils.trace_notification(event: event, tags: tags)
|
61
65
|
end
|
@@ -21,72 +21,76 @@ module Rails
|
|
21
21
|
unpermitted_parameters
|
22
22
|
].freeze
|
23
23
|
|
24
|
+
# rubocop:disable Style/MutableConstant
|
25
|
+
BASE_TAGS = { 'component' => 'ActionController' }
|
26
|
+
# rubocop:enable Style/MutableConstant.
|
27
|
+
|
24
28
|
class << self
|
25
29
|
def write_fragment(event)
|
26
|
-
tags =
|
30
|
+
tags = span_tags(
|
27
31
|
'key.write' => event.payload[:key]
|
28
|
-
|
32
|
+
)
|
29
33
|
|
30
34
|
Utils.trace_notification(event: event, tags: tags)
|
31
35
|
end
|
32
36
|
|
33
37
|
def read_fragment(event)
|
34
|
-
tags =
|
38
|
+
tags = span_tags(
|
35
39
|
'key.read' => event.payload[:key]
|
36
|
-
|
40
|
+
)
|
37
41
|
|
38
42
|
Utils.trace_notification(event: event, tags: tags)
|
39
43
|
end
|
40
44
|
|
41
45
|
def expire_fragment(event)
|
42
|
-
tags =
|
46
|
+
tags = span_tags(
|
43
47
|
'key.expire' => event.payload[:key]
|
44
|
-
|
48
|
+
)
|
45
49
|
|
46
50
|
Utils.trace_notification(event: event, tags: tags)
|
47
51
|
end
|
48
52
|
|
49
53
|
def exist_fragment?(event)
|
50
|
-
tags =
|
54
|
+
tags = span_tags(
|
51
55
|
'key.exist' => event.payload[:key]
|
52
|
-
|
56
|
+
)
|
53
57
|
|
54
58
|
Utils.trace_notification(event: event, tags: tags)
|
55
59
|
end
|
56
60
|
|
57
61
|
def write_page(event)
|
58
|
-
tags =
|
62
|
+
tags = span_tags(
|
59
63
|
'path.write' => event.payload[:path]
|
60
|
-
|
64
|
+
)
|
61
65
|
|
62
66
|
Utils.trace_notification(event: event, tags: tags)
|
63
67
|
end
|
64
68
|
|
65
69
|
def expire_page(event)
|
66
|
-
tags =
|
70
|
+
tags = span_tags(
|
67
71
|
'path.expire' => event.payload[:path]
|
68
|
-
|
72
|
+
)
|
69
73
|
|
70
74
|
Utils.trace_notification(event: event, tags: tags)
|
71
75
|
end
|
72
76
|
|
73
77
|
def start_processing(event)
|
74
|
-
tags =
|
78
|
+
tags = span_tags(
|
75
79
|
'controller' => event.payload[:controller],
|
76
80
|
'controller.action' => event.payload[:action],
|
77
81
|
'request.params' => event.payload[:params],
|
78
82
|
'request.format' => event.payload[:format],
|
79
83
|
'http.method' => event.payload[:method],
|
80
84
|
'http.url' => event.payload[:path]
|
81
|
-
|
85
|
+
)
|
82
86
|
|
83
87
|
Utils.trace_notification(event: event, tags: tags)
|
84
88
|
end
|
85
89
|
|
86
90
|
def process_action(event)
|
87
|
-
span_name = "#{event.payload[:
|
91
|
+
span_name = "#{event.payload[:controller]}.#{event.payload[:action]}"
|
88
92
|
|
89
|
-
tags =
|
93
|
+
tags = span_tags(
|
90
94
|
'controller' => event.payload[:controller],
|
91
95
|
'controller.action' => event.payload[:action],
|
92
96
|
'request.params' => event.payload[:params],
|
@@ -95,8 +99,15 @@ module Rails
|
|
95
99
|
'http.url' => event.payload[:path],
|
96
100
|
'http.status_code' => event.payload[:status],
|
97
101
|
'view.runtime.ms' => event.payload[:view_runtime],
|
98
|
-
'db.runtime.ms' => event.payload[:db_runtime]
|
99
|
-
|
102
|
+
'db.runtime.ms' => event.payload[:db_runtime],
|
103
|
+
'span.kind' => 'server'
|
104
|
+
)
|
105
|
+
|
106
|
+
|
107
|
+
status_code = event.payload[:status]
|
108
|
+
if status_code.is_a? Integer and status_code >= 500
|
109
|
+
tags['error'] = true
|
110
|
+
end
|
100
111
|
|
101
112
|
# Only append these tags onto the active span created by the patched 'process_action'
|
102
113
|
# Otherwise, create a new span for this notification as usual
|
@@ -105,15 +116,18 @@ module Rails
|
|
105
116
|
tags.each do |key, value|
|
106
117
|
::Rails::Instrumentation.tracer.active_span.set_tag(key, value)
|
107
118
|
end
|
119
|
+
if event.payload.key? :exception
|
120
|
+
Utils.tag_error(active_span, event.payload)
|
121
|
+
end
|
108
122
|
else
|
109
123
|
Utils.trace_notification(event: event, tags: tags)
|
110
124
|
end
|
111
125
|
end
|
112
126
|
|
113
127
|
def send_file(event)
|
114
|
-
tags =
|
128
|
+
tags = span_tags(
|
115
129
|
'path.send' => event.payload[:path]
|
116
|
-
|
130
|
+
)
|
117
131
|
|
118
132
|
# there may be additional keys in the payload. It might be worth
|
119
133
|
# trying to tag them too
|
@@ -125,30 +139,30 @@ module Rails
|
|
125
139
|
# no defined keys, but user keys may be passed in. Might want to add
|
126
140
|
# them at some point
|
127
141
|
|
128
|
-
Utils.trace_notification(event: event, tags:
|
142
|
+
Utils.trace_notification(event: event, tags: BASE_TAGS)
|
129
143
|
end
|
130
144
|
|
131
145
|
def redirect_to(event)
|
132
|
-
tags =
|
146
|
+
tags = span_tags(
|
133
147
|
'http.status_code' => event.payload[:status],
|
134
148
|
'redirect.url' => event.payload[:location]
|
135
|
-
|
149
|
+
)
|
136
150
|
|
137
151
|
Utils.trace_notification(event: event, tags: tags)
|
138
152
|
end
|
139
153
|
|
140
154
|
def halted_callback(event)
|
141
|
-
tags =
|
155
|
+
tags = span_tags(
|
142
156
|
'filter' => event.payload[:filter]
|
143
|
-
|
157
|
+
)
|
144
158
|
|
145
159
|
Utils.trace_notification(event: event, tags: tags)
|
146
160
|
end
|
147
161
|
|
148
162
|
def unpermitted_parameters(event)
|
149
|
-
tags =
|
163
|
+
tags = span_tags(
|
150
164
|
'unpermitted_keys' => event.payload[:keys]
|
151
|
-
|
165
|
+
)
|
152
166
|
|
153
167
|
Utils.trace_notification(event: event, tags: tags)
|
154
168
|
end
|
@@ -11,9 +11,13 @@ module Rails
|
|
11
11
|
process
|
12
12
|
].freeze
|
13
13
|
|
14
|
+
# rubocop:disable Style/MutableConstant
|
15
|
+
BASE_TAGS = { 'component' => 'ActionMailer' }
|
16
|
+
# rubocop:enable Style/MutableConstant.
|
17
|
+
|
14
18
|
class << self
|
15
19
|
def receive(event)
|
16
|
-
tags =
|
20
|
+
tags = span_tags(
|
17
21
|
'mailer' => event.payload[:mailer],
|
18
22
|
'message.id' => event.payload[:message_id],
|
19
23
|
'message.subject' => event.payload[:subject],
|
@@ -23,13 +27,13 @@ module Rails
|
|
23
27
|
'message.cc' => event.payload[:cc],
|
24
28
|
'message.date' => event.payload[:date],
|
25
29
|
'message.body' => event.payload[:mail]
|
26
|
-
|
30
|
+
)
|
27
31
|
|
28
32
|
Utils.trace_notification(event: event, tags: tags)
|
29
33
|
end
|
30
34
|
|
31
35
|
def deliver(event)
|
32
|
-
tags =
|
36
|
+
tags = span_tags(
|
33
37
|
'mailer' => event.payload[:mailer],
|
34
38
|
'message.id' => event.payload[:message_id],
|
35
39
|
'message.subject' => event.payload[:subject],
|
@@ -39,17 +43,17 @@ module Rails
|
|
39
43
|
'message.cc' => event.payload[:cc],
|
40
44
|
'message.date' => event.payload[:date],
|
41
45
|
'message.body' => event.payload[:mail]
|
42
|
-
|
46
|
+
)
|
43
47
|
|
44
48
|
Utils.trace_notification(event: event, tags: tags)
|
45
49
|
end
|
46
50
|
|
47
51
|
def process(event)
|
48
|
-
tags =
|
52
|
+
tags = span_tags(
|
49
53
|
'mailer' => event.payload[:mailer],
|
50
54
|
'action' => event.payload[:action],
|
51
55
|
'args' => event.payload[:args]
|
52
|
-
|
56
|
+
)
|
53
57
|
|
54
58
|
Utils.trace_notification(event: event, tags: tags)
|
55
59
|
end
|
@@ -11,29 +11,33 @@ module Rails
|
|
11
11
|
render_collection
|
12
12
|
].freeze
|
13
13
|
|
14
|
+
# rubocop:disable Style/MutableConstant
|
15
|
+
BASE_TAGS = { 'component' => 'ActionView' }
|
16
|
+
# rubocop:enable Style/MutableConstant.
|
17
|
+
|
14
18
|
class << self
|
15
19
|
def render_template(event)
|
16
|
-
tags =
|
20
|
+
tags = span_tags(
|
17
21
|
'template.identifier' => event.payload[:identifier],
|
18
22
|
'template.layout' => event.payload[:layout]
|
19
|
-
|
23
|
+
)
|
20
24
|
|
21
25
|
Utils.trace_notification(event: event, tags: tags)
|
22
26
|
end
|
23
27
|
|
24
28
|
def render_partial(event)
|
25
|
-
tags =
|
29
|
+
tags = span_tags(
|
26
30
|
'partial.identifier' => event.payload[:identifier]
|
27
|
-
|
31
|
+
)
|
28
32
|
|
29
33
|
Utils.trace_notification(event: event, tags: tags)
|
30
34
|
end
|
31
35
|
|
32
36
|
def render_collection(event)
|
33
|
-
tags =
|
37
|
+
tags = span_tags(
|
34
38
|
'template.identifier' => event.payload[:identifier],
|
35
39
|
'template.count' => event.payload[:count]
|
36
|
-
|
40
|
+
)
|
37
41
|
tags['template.cache_hits'] = event.payload[:cache_hits] if event.payload.key? :cache_hits
|
38
42
|
|
39
43
|
Utils.trace_notification(event: event, tags: tags)
|
@@ -12,39 +12,43 @@ module Rails
|
|
12
12
|
perform
|
13
13
|
].freeze
|
14
14
|
|
15
|
+
# rubocop:disable Style/MutableConstant
|
16
|
+
BASE_TAGS = { 'component' => 'ActiveJob' }
|
17
|
+
# rubocop:enable Style/MutableConstant.
|
18
|
+
|
15
19
|
class << self
|
16
20
|
def enqueue_at(event)
|
17
|
-
tags =
|
21
|
+
tags = span_tags(
|
18
22
|
'adapter' => event.payload[:adapter],
|
19
23
|
'job' => event.payload[:job]
|
20
|
-
|
24
|
+
)
|
21
25
|
|
22
26
|
Utils.trace_notification(event: event, tags: tags)
|
23
27
|
end
|
24
28
|
|
25
29
|
def enqueue(event)
|
26
|
-
tags =
|
30
|
+
tags = span_tags(
|
27
31
|
'adapter' => event.payload[:adapter],
|
28
32
|
'job' => event.payload[:job]
|
29
|
-
|
33
|
+
)
|
30
34
|
|
31
35
|
Utils.trace_notification(event: event, tags: tags)
|
32
36
|
end
|
33
37
|
|
34
38
|
def perform_start(event)
|
35
|
-
tags =
|
39
|
+
tags = span_tags(
|
36
40
|
'adapter' => event.payload[:adapter],
|
37
41
|
'job' => event.payload[:job]
|
38
|
-
|
42
|
+
)
|
39
43
|
|
40
44
|
Utils.trace_notification(event: event, tags: tags)
|
41
45
|
end
|
42
46
|
|
43
47
|
def perform(event)
|
44
|
-
tags =
|
48
|
+
tags = span_tags(
|
45
49
|
'adapter' => event.payload[:adapter],
|
46
50
|
'job' => event.payload[:job]
|
47
|
-
|
51
|
+
)
|
48
52
|
|
49
53
|
Utils.trace_notification(event: event, tags: tags)
|
50
54
|
end
|
@@ -12,24 +12,30 @@ module Rails
|
|
12
12
|
instantiation
|
13
13
|
].freeze
|
14
14
|
|
15
|
+
# rubocop:disable Style/MutableConstant
|
16
|
+
BASE_TAGS = { 'component' => 'ActiveRecord' }
|
17
|
+
# rubocop:enable Style/MutableConstant.
|
18
|
+
|
15
19
|
class << self
|
16
20
|
def sql(event)
|
17
|
-
|
18
|
-
|
21
|
+
raw = event.payload[:sql]
|
22
|
+
statement = raw.respond_to?(:to_str) ? raw : raw.to_s
|
23
|
+
tags = span_tags(
|
24
|
+
'db.statement' => statement[0, 1024],
|
19
25
|
'name' => event.payload[:name],
|
20
26
|
'connection_id' => event.payload[:connection_id],
|
21
27
|
'binds' => event.payload[:binds],
|
22
28
|
'cached' => event.payload[:cached]
|
23
|
-
|
29
|
+
)
|
24
30
|
|
25
31
|
Utils.trace_notification(event: event, tags: tags)
|
26
32
|
end
|
27
33
|
|
28
34
|
def instantiation(event)
|
29
|
-
tags =
|
35
|
+
tags = span_tags(
|
30
36
|
'record.count' => event.payload[:record_count],
|
31
37
|
'record.class' => event.payload[:class_name]
|
32
|
-
|
38
|
+
)
|
33
39
|
|
34
40
|
Utils.trace_notification(event: event, tags: tags)
|
35
41
|
end
|
@@ -15,69 +15,73 @@ module Rails
|
|
15
15
|
service_url
|
16
16
|
].freeze
|
17
17
|
|
18
|
+
# rubocop:disable Style/MutableConstant
|
19
|
+
BASE_TAGS = { 'component' => 'ActiveStorage' }
|
20
|
+
# rubocop:enable Style/MutableConstant.
|
21
|
+
|
18
22
|
class << self
|
19
23
|
def service_upload(event)
|
20
|
-
tags =
|
24
|
+
tags = span_tags(
|
21
25
|
'key' => event.payload[:key],
|
22
26
|
'service' => event.payload[:service],
|
23
27
|
'checksum' => event.payload[:checksum]
|
24
|
-
|
28
|
+
)
|
25
29
|
|
26
30
|
Utils.trace_notification(event: event, tags: tags)
|
27
31
|
end
|
28
32
|
|
29
33
|
def service_streaming_download(event)
|
30
|
-
tags =
|
34
|
+
tags = span_tags(
|
31
35
|
'key' => event.payload[:key],
|
32
36
|
'service' => event.payload[:service]
|
33
|
-
|
37
|
+
)
|
34
38
|
|
35
39
|
Utils.trace_notification(event: event, tags: tags)
|
36
40
|
end
|
37
41
|
|
38
42
|
def service_download(event)
|
39
|
-
tags =
|
43
|
+
tags = span_tags(
|
40
44
|
'key' => event.payload[:key],
|
41
45
|
'service' => event.payload[:service]
|
42
|
-
|
46
|
+
)
|
43
47
|
|
44
48
|
Utils.trace_notification(event: event, tags: tags)
|
45
49
|
end
|
46
50
|
|
47
51
|
def service_delete(event)
|
48
|
-
tags =
|
52
|
+
tags = span_tags(
|
49
53
|
'key' => event.payload[:key],
|
50
54
|
'service' => event.payload[:service]
|
51
|
-
|
55
|
+
)
|
52
56
|
|
53
57
|
Utils.trace_notification(event: event, tags: tags)
|
54
58
|
end
|
55
59
|
|
56
60
|
def service_delete_prefixed(event)
|
57
|
-
tags =
|
61
|
+
tags = span_tags(
|
58
62
|
'key.prefix' => event.payload[:prefix],
|
59
63
|
'service' => event.payload[:service]
|
60
|
-
|
64
|
+
)
|
61
65
|
|
62
66
|
Utils.trace_notification(event: event, tags: tags)
|
63
67
|
end
|
64
68
|
|
65
69
|
def service_exist(event)
|
66
|
-
tags =
|
70
|
+
tags = span_tags(
|
67
71
|
'key' => event.payload[:key],
|
68
72
|
'service' => event.payload[:service],
|
69
73
|
'exist' => event.payload[:exist]
|
70
|
-
|
74
|
+
)
|
71
75
|
|
72
76
|
Utils.trace_notification(event: event, tags: tags)
|
73
77
|
end
|
74
78
|
|
75
79
|
def service_url(event)
|
76
|
-
tags =
|
80
|
+
tags = span_tags(
|
77
81
|
'key' => event.payload[:key],
|
78
82
|
'service' => event.payload[:service],
|
79
83
|
'url' => event.payload[:url] # generated url, not accessed url
|
80
|
-
|
84
|
+
)
|
81
85
|
|
82
86
|
Utils.trace_notification(event: event, tags: tags)
|
83
87
|
end
|
@@ -14,53 +14,57 @@ module Rails
|
|
14
14
|
cache_exist?
|
15
15
|
].freeze
|
16
16
|
|
17
|
+
# rubocop:disable Style/MutableConstant
|
18
|
+
BASE_TAGS = { 'component' => 'ActiveSupport' }
|
19
|
+
# rubocop:enable Style/MutableConstant.
|
20
|
+
|
17
21
|
class << self
|
18
22
|
def cache_read(event)
|
19
|
-
tags =
|
23
|
+
tags = span_tags(
|
20
24
|
'key' => event.payload[:key],
|
21
25
|
'hit' => event.payload[:hit],
|
22
26
|
'super_operation' => event.payload[:super_operation]
|
23
|
-
|
27
|
+
)
|
24
28
|
|
25
29
|
Utils.trace_notification(event: event, tags: tags)
|
26
30
|
end
|
27
31
|
|
28
32
|
def cache_generate(event)
|
29
|
-
tags =
|
33
|
+
tags = span_tags(
|
30
34
|
'key' => event.payload[:key]
|
31
|
-
|
35
|
+
)
|
32
36
|
|
33
37
|
Utils.trace_notification(event: event, tags: tags)
|
34
38
|
end
|
35
39
|
|
36
40
|
def cache_fetch_hit(event)
|
37
|
-
tags =
|
41
|
+
tags = span_tags(
|
38
42
|
'key' => event.payload[:key]
|
39
|
-
|
43
|
+
)
|
40
44
|
|
41
45
|
Utils.trace_notification(event: event, tags: tags)
|
42
46
|
end
|
43
47
|
|
44
48
|
def cache_write(event)
|
45
|
-
tags =
|
49
|
+
tags = span_tags(
|
46
50
|
'key' => event.payload[:key]
|
47
|
-
|
51
|
+
)
|
48
52
|
|
49
53
|
Utils.trace_notification(event: event, tags: tags)
|
50
54
|
end
|
51
55
|
|
52
56
|
def cache_delete(event)
|
53
|
-
tags =
|
57
|
+
tags = span_tags(
|
54
58
|
'key' => event.payload[:key]
|
55
|
-
|
59
|
+
)
|
56
60
|
|
57
61
|
Utils.trace_notification(event: event, tags: tags)
|
58
62
|
end
|
59
63
|
|
60
64
|
def cache_exist?(event)
|
61
|
-
tags =
|
65
|
+
tags = span_tags(
|
62
66
|
'key' => event.payload[:key]
|
63
|
-
|
67
|
+
)
|
64
68
|
|
65
69
|
Utils.trace_notification(event: event, tags: tags)
|
66
70
|
end
|
@@ -18,7 +18,7 @@ module Rails
|
|
18
18
|
# takes and event and some set of tags from a handler, and creates a
|
19
19
|
# span with the event's name and the start and finish times.
|
20
20
|
def trace_notification(event:, tags: [])
|
21
|
-
tags =
|
21
|
+
tags = ::Rails::Instrumentation::TAGS.clone.merge(tags)
|
22
22
|
|
23
23
|
span = ::Rails::Instrumentation.tracer.start_span(event.name,
|
24
24
|
tags: tags,
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_dependency 'opentracing', '~> 0.3'
|
24
24
|
spec.add_development_dependency 'appraisal', '~> 2.2'
|
25
|
-
spec.add_development_dependency 'bundler', '
|
25
|
+
spec.add_development_dependency 'bundler', '>= 1.17'
|
26
26
|
spec.add_development_dependency 'opentracing_test_tracer', '~> 0.1'
|
27
27
|
spec.add_development_dependency 'rails', '~> 5.2.2'
|
28
28
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-instrumentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashwin Chandrasekar
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentracing
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.17'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.17'
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '1.31'
|
139
|
-
description:
|
139
|
+
description:
|
140
140
|
email:
|
141
141
|
- achandrasekar@signalfx.com
|
142
142
|
executables: []
|
@@ -169,7 +169,7 @@ files:
|
|
169
169
|
homepage: https://github.com/signalfx/ruby-rails-instrumentation
|
170
170
|
licenses: []
|
171
171
|
metadata: {}
|
172
|
-
post_install_message:
|
172
|
+
post_install_message:
|
173
173
|
rdoc_options: []
|
174
174
|
require_paths:
|
175
175
|
- lib
|
@@ -184,8 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
- !ruby/object:Gem::Version
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
188
|
-
signing_key:
|
187
|
+
rubygems_version: 3.1.2
|
188
|
+
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: OpenTracing instrumentation for Rails.
|
191
191
|
test_files: []
|