zuora_observability 0.3.0 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/tagged_logging.rb +39 -0
- data/lib/zuora_observability/engine.rb +2 -0
- data/lib/zuora_observability/logger.rb +5 -0
- data/lib/zuora_observability/logging/custom_options.rb +0 -1
- data/lib/zuora_observability/logging/formatter.rb +3 -1
- data/lib/zuora_observability/version.rb +1 -1
- metadata +4 -6
- data/app/jobs/zuora_observability/application_job.rb +0 -4
- data/app/mailers/zuora_observability/application_mailer.rb +0 -6
- data/app/models/zuora_observability/application_record.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91f680541f7eca83fa2a24aa721bb70c36b266e3ed2688b4311d4aa357cba5a8
|
4
|
+
data.tar.gz: 73bba0de9a68376e11484881afcc38280a0f6b7aa53ffba1cf9c8013289f42d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e36d3484052f8a857aaf17fac5fb2c142e6f6370ff9b0d19ae6a8088948e2920c9d524bd737303a790bd060f2205c8d14cb2b0a500e30ef579a8c52a52af6592
|
7
|
+
data.tar.gz: d0921b1f65bc227f695f995f657732e38c549a53f89a4b967df89d2e669b99d30b88d392e8d0bb1a4b9535a747de3db5c22ee203cf76ac918e17875905f29210
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ActiveSupport
|
4
|
+
module TaggedLogging
|
5
|
+
# Patch to apply structured tags to Tagged Logs
|
6
|
+
module Formatter
|
7
|
+
def call(severity, timestamp, progname, data)
|
8
|
+
super(severity, timestamp, progname, merged_tags.merge!(data))
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def merged_tags
|
14
|
+
tags = {}
|
15
|
+
|
16
|
+
current_tags.each do |tag|
|
17
|
+
tags.merge!(tag) if tag.is_a?(Hash)
|
18
|
+
end
|
19
|
+
|
20
|
+
tags
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module Rails
|
27
|
+
module Rack
|
28
|
+
# Patch to compute structured tags for Tagged Logging
|
29
|
+
class Logger
|
30
|
+
private
|
31
|
+
|
32
|
+
def compute_tags(request)
|
33
|
+
{
|
34
|
+
trace_id: request.uuid
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -59,6 +59,11 @@ module ZuoraObservability
|
|
59
59
|
if type == :ougai
|
60
60
|
logger = new($stdout, level: level, progname: name)
|
61
61
|
else
|
62
|
+
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
63
|
+
Creating a non-ougai custom_logger is deprecated and will be removed
|
64
|
+
in a future version of zuora_observability.
|
65
|
+
MSG
|
66
|
+
|
62
67
|
require 'mono_logger'
|
63
68
|
logger = MonoLogger.new(STDOUT)
|
64
69
|
logger.level = level
|
@@ -25,7 +25,6 @@ module ZuoraObservability
|
|
25
25
|
items = {
|
26
26
|
msg: 'Rails Request',
|
27
27
|
params: event.payload[:params].as_json(except: IGNORE_PARAMS).to_s,
|
28
|
-
trace_id: event.payload[:headers]['action_dispatch.request_id'],
|
29
28
|
zuora_trace_id: event.payload[:headers]['HTTP_ZUORA_REQUEST_ID'],
|
30
29
|
error: event.payload[:exception_object]
|
31
30
|
}
|
@@ -155,6 +155,7 @@ module ZuoraObservability
|
|
155
155
|
def base_fields(data)
|
156
156
|
{
|
157
157
|
cp_id: data[:zuora_track_id],
|
158
|
+
entity_ids: data[:entity_ids],
|
158
159
|
environment: data[:environment],
|
159
160
|
tenant_id: data[:tenant_ids],
|
160
161
|
trace_id: data[:zuora_trace_id]
|
@@ -164,11 +165,12 @@ module ZuoraObservability
|
|
164
165
|
# zuora.http
|
165
166
|
def http_fields(data)
|
166
167
|
z_http_request = {
|
167
|
-
headers: data[:headers],
|
168
|
+
headers: data[:headers] || data.dig(:request, :headers),
|
168
169
|
headers_blob: data.dig(:request, :headers_blob)
|
169
170
|
}.compact
|
170
171
|
|
171
172
|
z_http_response = {
|
173
|
+
headers: data.dig(:response, :headers),
|
172
174
|
headers_blob: data.dig(:response, :headers_blob)
|
173
175
|
}.compact
|
174
176
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuora_observability
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hartley McGuire
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lograge
|
@@ -247,11 +247,9 @@ files:
|
|
247
247
|
- app/controllers/zuora_observability/application_controller.rb
|
248
248
|
- app/controllers/zuora_observability/metrics_controller.rb
|
249
249
|
- app/helpers/zuora_observability/application_helper.rb
|
250
|
-
- app/jobs/zuora_observability/application_job.rb
|
251
|
-
- app/mailers/zuora_observability/application_mailer.rb
|
252
|
-
- app/models/zuora_observability/application_record.rb
|
253
250
|
- app/views/layouts/zuora_observability/application.html.erb
|
254
251
|
- config/initializers/loggers.rb
|
252
|
+
- config/initializers/tagged_logging.rb
|
255
253
|
- config/routes.rb
|
256
254
|
- lib/tasks/zuora_observability_tasks.rake
|
257
255
|
- lib/zuora_observability.rb
|
@@ -282,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
280
|
- !ruby/object:Gem::Version
|
283
281
|
version: '0'
|
284
282
|
requirements: []
|
285
|
-
rubygems_version: 3.2.
|
283
|
+
rubygems_version: 3.2.22
|
286
284
|
signing_key:
|
287
285
|
specification_version: 4
|
288
286
|
summary: Summary of ZuoraObservability.
|