Skip to content

Commit e86d81a

Browse files
authored
feat: Handle HTTP 2XX responses as successful in OTLP exporters (#2044)
* Change response check from HTTPOK to HTTPSuccess * Trigger build * Trigger build * Change response check from HTTPOK to HTTPSuccess
1 parent 0f7890b commit e86d81a

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

exporter/otlp-http/lib/opentelemetry/exporter/otlp/http/trace_exporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/MethodLength
157157
response = measure_request_duration { @http.request(request) }
158158

159159
case response
160-
when Net::HTTPOK
160+
when Net::HTTPSuccess
161161
response.body # Read and discard body
162162
SUCCESS
163163
when Net::HTTPServiceUnavailable, Net::HTTPTooManyRequests

exporter/otlp-logs/lib/opentelemetry/exporter/otlp/logs/logs_exporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/CyclomaticComplexity,
166166
response = @http.request(request)
167167

168168
case response
169-
when Net::HTTPOK
169+
when Net::HTTPSuccess
170170
response.body # Read and discard body
171171
SUCCESS
172172
when Net::HTTPServiceUnavailable, Net::HTTPTooManyRequests

exporter/otlp-metrics/lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def send_bytes(bytes, timeout:)
119119
@http.start unless @http.started?
120120
response = @http.request(request)
121121
case response
122-
when Net::HTTPOK
122+
when Net::HTTPSuccess
123123
response.body # Read and discard body
124124
SUCCESS
125125
when Net::HTTPServiceUnavailable, Net::HTTPTooManyRequests

exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/CyclomaticComplexity,
177177
response = measure_request_duration { @http.request(request) }
178178

179179
case response
180-
when Net::HTTPOK
180+
when Net::HTTPSuccess
181181
response.body # Read and discard body
182182
SUCCESS
183183
when Net::HTTPServiceUnavailable, Net::HTTPTooManyRequests

0 commit comments

Comments
 (0)