aws-sdk-core 3.44.1 → 3.44.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +57 -4
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +16 -1
- data/lib/aws-sdk-core/refreshing_credentials.rb +1 -1
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a0a473b01cf3a0b146f109af28816fa8651a7b3
|
4
|
+
data.tar.gz: 8c22a15e4ca2721cf01f80bc47b300bfd2bda311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d99679d6802516b740f9bfa1034d49352e7ef7d3e30a32f91874da2f9cf2006e6005fe866040f5d7797267b7f778d2023469f59467742229d7d03b79c2dffee1
|
7
|
+
data.tar.gz: 983c5511c2f47103c44a4e1909ad755f508860238cfb5c30b7c7e607b9c2844a95470d08bd76238843cfce70d6449c2e66071761d6756f292df4f7033662fc21
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.44.
|
1
|
+
3.44.2
|
@@ -4,6 +4,19 @@ module Aws
|
|
4
4
|
class RequestMetrics
|
5
5
|
attr_reader :api_call, :api_call_attempts
|
6
6
|
|
7
|
+
FIELD_MAX_LENGTH = {
|
8
|
+
"ClientId" => 255,
|
9
|
+
"UserAgent" => 256,
|
10
|
+
"SdkException" => 128,
|
11
|
+
"SdkExceptionMessage" => 512,
|
12
|
+
"AwsException" => 128,
|
13
|
+
"AwsExceptionMessage" => 512,
|
14
|
+
"FinalAwsException" => 128,
|
15
|
+
"FinalAwsExceptionMessage" => 512,
|
16
|
+
"FinalSdkException" => 128,
|
17
|
+
"FinalSdkExceptionMessage" => 512,
|
18
|
+
}
|
19
|
+
|
7
20
|
def initialize(opts = {})
|
8
21
|
@service = opts[:service]
|
9
22
|
@api = opts[:operation]
|
@@ -42,7 +55,10 @@ module Aws
|
|
42
55
|
|
43
56
|
class ApiCall
|
44
57
|
attr_reader :service, :api, :client_id, :timestamp, :version,
|
45
|
-
:attempt_count, :latency, :region, :max_retries_exceeded
|
58
|
+
:attempt_count, :latency, :region, :max_retries_exceeded,
|
59
|
+
:final_http_status_code, :user_agent, :final_aws_exception,
|
60
|
+
:final_aws_exception_message, :final_sdk_exception,
|
61
|
+
:final_sdk_exception_message
|
46
62
|
|
47
63
|
def initialize(service, api, client_id, version, timestamp, region)
|
48
64
|
@service = service
|
@@ -56,15 +72,21 @@ module Aws
|
|
56
72
|
def complete(opts = {})
|
57
73
|
@latency = opts[:latency]
|
58
74
|
@attempt_count = opts[:attempt_count]
|
75
|
+
@user_agent = opts[:user_agent]
|
59
76
|
if opts[:final_error_retryable]
|
60
77
|
@max_retries_exceeded = 1
|
61
78
|
else
|
62
79
|
@max_retries_exceeded = 0
|
63
80
|
end
|
81
|
+
@final_http_status_code = opts[:final_http_status_code]
|
82
|
+
@final_aws_exception = opts[:final_aws_exception]
|
83
|
+
@final_aws_exception_message = opts[:final_aws_exception_message]
|
84
|
+
@final_sdk_exception = opts[:final_sdk_exception]
|
85
|
+
@final_sdk_exception_message = opts[:final_sdk_exception_message]
|
64
86
|
end
|
65
87
|
|
66
88
|
def to_json(*a)
|
67
|
-
{
|
89
|
+
document = {
|
68
90
|
"Type" => "ApiCall",
|
69
91
|
"Service" => @service,
|
70
92
|
"Api" => @api,
|
@@ -74,8 +96,27 @@ module Aws
|
|
74
96
|
"AttemptCount" => @attempt_count,
|
75
97
|
"Latency" => @latency,
|
76
98
|
"Region" => @region,
|
77
|
-
"MaxRetriesExceeded" => @max_retries_exceeded
|
78
|
-
|
99
|
+
"MaxRetriesExceeded" => @max_retries_exceeded,
|
100
|
+
"UserAgent" => @user_agent,
|
101
|
+
"FinalHttpStatusCode" => @final_http_status_code,
|
102
|
+
}
|
103
|
+
document["FinalSdkException"] = @final_sdk_exception if @final_sdk_exception
|
104
|
+
document["FinalSdkExceptionMessage"] = @final_sdk_exception_message if @final_sdk_exception_message
|
105
|
+
document["FinalAwsException"] = @final_aws_exception if @final_aws_exception
|
106
|
+
document["FinalAwsExceptionMessage"] = @final_aws_exception_message if @final_aws_exception_message
|
107
|
+
document = _truncate(document)
|
108
|
+
document.to_json
|
109
|
+
end
|
110
|
+
|
111
|
+
private
|
112
|
+
def _truncate(document)
|
113
|
+
document.each do |key, value|
|
114
|
+
limit = FIELD_MAX_LENGTH[key]
|
115
|
+
if limit && value.to_s.length > limit
|
116
|
+
document[key] = value.to_s.slice(0...limit)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
document
|
79
120
|
end
|
80
121
|
end
|
81
122
|
|
@@ -134,8 +175,20 @@ module Aws
|
|
134
175
|
json["AttemptLatency"] = @request_latency if @request_latency
|
135
176
|
json["SdkException"] = @sdk_exception if @sdk_exception
|
136
177
|
json["SdkExceptionMessage"] = @sdk_exception_msg if @sdk_exception_msg
|
178
|
+
json = _truncate(json)
|
137
179
|
json.to_json
|
138
180
|
end
|
181
|
+
|
182
|
+
private
|
183
|
+
def _truncate(document)
|
184
|
+
document.each do |key, value|
|
185
|
+
limit = FIELD_MAX_LENGTH[key]
|
186
|
+
if limit && value.to_s.length > limit
|
187
|
+
document[key] = value.to_s.slice(0...limit)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
document
|
191
|
+
end
|
139
192
|
end
|
140
193
|
|
141
194
|
end
|
@@ -109,6 +109,10 @@ all generated client side metrics. Defaults to an empty string.
|
|
109
109
|
context.metadata[:client_metrics] = request_metrics
|
110
110
|
start_time = Aws::Util.monotonic_milliseconds
|
111
111
|
final_error_retryable = false
|
112
|
+
final_aws_exception = nil
|
113
|
+
final_aws_exception_message = nil
|
114
|
+
final_sdk_exception = nil
|
115
|
+
final_sdk_exception_message = nil
|
112
116
|
begin
|
113
117
|
@handler.call(context)
|
114
118
|
rescue StandardError => e
|
@@ -137,13 +141,24 @@ all generated client side metrics. Defaults to an empty string.
|
|
137
141
|
attempt.sdk_exception = e.class.to_s
|
138
142
|
attempt.sdk_exception_msg = e.message
|
139
143
|
end # Else we don't have an SDK exception and are done.
|
144
|
+
final_attempt = request_metrics.api_call_attempts.last
|
145
|
+
final_aws_exception = final_attempt.aws_exception
|
146
|
+
final_aws_exception_message = final_attempt.aws_exception_msg
|
147
|
+
final_sdk_exception = final_attempt.sdk_exception
|
148
|
+
final_sdk_exception_message = final_attempt.sdk_exception_msg
|
140
149
|
raise e
|
141
150
|
ensure
|
142
151
|
end_time = Aws::Util.monotonic_milliseconds
|
143
152
|
request_metrics.api_call.complete(
|
144
153
|
latency: end_time - start_time,
|
145
154
|
attempt_count: context.retries + 1,
|
146
|
-
|
155
|
+
user_agent: context.http_request.headers["user-agent"],
|
156
|
+
final_error_retryable: final_error_retryable,
|
157
|
+
final_http_status_code: context.http_response.status_code,
|
158
|
+
final_aws_exception: final_aws_exception,
|
159
|
+
final_aws_exception_message: final_aws_exception_message,
|
160
|
+
final_sdk_exception: final_sdk_exception,
|
161
|
+
final_sdk_exception_message: final_sdk_exception_message,
|
147
162
|
)
|
148
163
|
# Report the metrics by passing the complete RequestMetrics object
|
149
164
|
if publisher
|
@@ -3,7 +3,7 @@ require 'thread'
|
|
3
3
|
module Aws
|
4
4
|
|
5
5
|
# Base class used credential classes that can be refreshed. This
|
6
|
-
# provides basic refresh logic in a thread-safe
|
6
|
+
# provides basic refresh logic in a thread-safe manner. Classes mixing in
|
7
7
|
# this module are expected to implement a #refresh method that populates
|
8
8
|
# the following instance variables:
|
9
9
|
#
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.44.
|
4
|
+
version: 3.44.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|