lib/opentelemetry/instrumentation/http_client/patches/client.rb in opentelemetry-instrumentation-http_client-0.18.0 vs lib/opentelemetry/instrumentation/http_client/patches/client.rb in opentelemetry-instrumentation-http_client-0.19.0
- old
+ new
@@ -39,12 +39,10 @@
return unless response&.status_code
status_code = response.status_code.to_i
span.set_attribute('http.status_code', status_code)
- span.status = OpenTelemetry::Trace::Status.http_to_status(
- status_code
- )
+ span.status = OpenTelemetry::Trace::Status.error unless (100..399).include?(status_code.to_i)
end
def tracer
HttpClient::Instrumentation.instance.tracer
end