zuora_observability 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6d0f3a139bf8fb34c6d9eb5cda9f00e70454dca7eca5d5d805a1c5e3fd63db8
4
- data.tar.gz: 0deaaad02637351504969a88c05156944aff6121f06af6ea092662591828911c
3
+ metadata.gz: 664115d7965e1d549ab2bb227565f51379a7ba3cc4ca0205d80523024918e0f4
4
+ data.tar.gz: 2ce847ad2f5ed52a267c2cbf2ea5496a1d700d78240b3680fc25f037c5fd0d8a
5
5
  SHA512:
6
- metadata.gz: 37bd27174e6e17457f24bdbecda6684de98a33a959403943ee02731cf763519b4cae6daa06ae1c58ca8f0ddb02924e1178c191a5170577f70e0112700a18cab9
7
- data.tar.gz: 6c75b2300f11d99fc8f94e88cb618e6da59ee686c51fed7b78a1a8e0b12972a613422cba1ae21ed26d686279d9c7f0802fa52a6c53955172aca651cfe4794851
6
+ metadata.gz: dd64817b0143ae8213875a024da8c3546d4b70fba916ca930860dab84a66522ae25733657f3a929a1d12161ce7d24dc7c305a4df98a13576c9d10e55f1116bef
7
+ data.tar.gz: ece638c0238dd314be5cdc3ed5a62317f44c3eb15f75bdf63a6443024cbd7a5f89619cf7d0ed7d7c282e7a9cdb4201259ac1c15e1eddd4d1cbc00c4cbb3f8e65
@@ -43,7 +43,7 @@ module ZuoraObservability
43
43
  private
44
44
 
45
45
  def app_parent_name
46
- if Rails::VERSION::MAJOR >= 6 && Rails::VERSION::MINOR >= 1
46
+ if Rails::VERSION::MAJOR >= 6
47
47
  Rails.application.class.module_parent_name
48
48
  else
49
49
  Rails.application.class.parent_name
@@ -59,19 +59,13 @@ module ZuoraObservability
59
59
  def error_fields(data)
60
60
  return {} unless data[:error] || data[:err]
61
61
 
62
- if data[:error]
63
- {
64
- message: data[:error].message,
65
- stack_trace: data[:error].backtrace.join("\n"),
66
- type: data[:error].class
67
- }.compact
68
- else
69
- {
70
- message: data.dig(:err, :message),
71
- stack_trace: data.dig(:err, :stack),
72
- type: data.dig(:err, :name)
73
- }.compact
74
- end
62
+ error = data[:err] || serialize_exc(data[:error])
63
+
64
+ {
65
+ message: error[:message],
66
+ stack_trace: error[:stack],
67
+ type: error[:name]
68
+ }.compact
75
69
  end
76
70
 
77
71
  # http
@@ -81,17 +75,21 @@ module ZuoraObservability
81
75
 
82
76
  # http.request
83
77
  def request_fields(data)
78
+ request = data.slice(:method, :params).merge(data.fetch(:request, {}))
79
+
84
80
  {
85
- method: data[:method],
86
- body: ({ content: data[:params] } if data.key? :params)
81
+ method: request[:method],
82
+ body: ({ content: request[:params] } if request.key? :params)
87
83
  }.compact
88
84
  end
89
85
 
90
86
  # http.response
91
87
  def response_fields(data)
88
+ response = data.slice(:status).merge(data.fetch(:response, {}))
89
+
92
90
  {
93
- status_code: data[:status],
94
- body: data[:response_body]
91
+ status_code: response[:status],
92
+ body: ({ content: response[:params] } if response.key? :params),
95
93
  }.compact
96
94
  end
97
95
 
@@ -110,6 +108,7 @@ module ZuoraObservability
110
108
  # url
111
109
  def url_fields(data)
112
110
  {
111
+ full: data.dig(:url, :full),
113
112
  path: data[:path]
114
113
  }.compact
115
114
  end
@@ -164,10 +163,18 @@ module ZuoraObservability
164
163
 
165
164
  # zuora.http
166
165
  def http_fields(data)
167
- z_http_request = { headers: data[:headers] }.compact
166
+ z_http_request = {
167
+ headers: data[:headers],
168
+ headers_blob: data.dig(:request, :headers_blob)
169
+ }.compact
170
+
171
+ z_http_response = {
172
+ headers_blob: data.dig(:response, :headers_blob)
173
+ }.compact
168
174
 
169
175
  {
170
- request: (z_http_request unless z_http_request.empty?)
176
+ request: (z_http_request unless z_http_request.empty?),
177
+ response: (z_http_response unless z_http_response.empty?)
171
178
  }.compact
172
179
  end
173
180
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZuoraObservability
4
- VERSION = '0.2.2'
4
+ VERSION = '0.3.0'
5
5
  end
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.2.2
4
+ version: 0.3.0
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-04-16 00:00:00.000000000 Z
11
+ date: 2021-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lograge