lib/opentelemetry/instrumentation/http/patches/client.rb in opentelemetry-instrumentation-http-0.18.0 vs lib/opentelemetry/instrumentation/http/patches/client.rb in opentelemetry-instrumentation-http-0.19.0
- old
+ new
@@ -36,10 +36,10 @@
def annotate_span_with_response!(span, response)
return unless response&.status
status_code = response.status.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
HTTP::Instrumentation.instance.tracer
end