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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d4350ab6286f6aa63905d7ae4bd3b2fd1b3330e
4
- data.tar.gz: a1f992aa92e626198755f94c870133cab91aa6fe
3
+ metadata.gz: 6a0a473b01cf3a0b146f109af28816fa8651a7b3
4
+ data.tar.gz: 8c22a15e4ca2721cf01f80bc47b300bfd2bda311
5
5
  SHA512:
6
- metadata.gz: 4709d785f9e7dfa99dbf3cddcec84fb01aae2ed58d742b225317da56ffe920f1e3912d66e920927cbe8ba78c16b7ba403b53e6805e99dabb6683eae72573c371
7
- data.tar.gz: 9442e1cb9452667a8e6dedfe3b61401972ecc2637fb8e0d044a6ee5967504202cb467856aadb9533e2fec8183857ec4f4ae49d6b6920624aa8a88afcad48a546
6
+ metadata.gz: d99679d6802516b740f9bfa1034d49352e7ef7d3e30a32f91874da2f9cf2006e6005fe866040f5d7797267b7f778d2023469f59467742229d7d03b79c2dffee1
7
+ data.tar.gz: 983c5511c2f47103c44a4e1909ad755f508860238cfb5c30b7c7e607b9c2844a95470d08bd76238843cfce70d6449c2e66071761d6756f292df4f7033662fc21
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.44.1
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
- }.to_json
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
- final_error_retryable: final_error_retryable
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 manor. Classes mixing in
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
  #
@@ -40,6 +40,6 @@ require_relative 'aws-sdk-sts/customizations'
40
40
  # @service
41
41
  module Aws::STS
42
42
 
43
- GEM_VERSION = '3.44.1'
43
+ GEM_VERSION = '3.44.2'
44
44
 
45
45
  end
@@ -1535,7 +1535,7 @@ module Aws::STS
1535
1535
  params: params,
1536
1536
  config: config)
1537
1537
  context[:gem_name] = 'aws-sdk-core'
1538
- context[:gem_version] = '3.44.1'
1538
+ context[:gem_version] = '3.44.2'
1539
1539
  Seahorse::Client::Request.new(handlers, context)
1540
1540
  end
1541
1541
 
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.1
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: 2018-12-17 00:00:00.000000000 Z
11
+ date: 2019-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath