lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb in opentelemetry-instrumentation-net_http-0.18.0 vs lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb in opentelemetry-instrumentation-net_http-0.19.0
- old
+ new
@@ -62,12 +62,10 @@
return unless response&.code
status_code = response.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
Net::HTTP::Instrumentation.instance.tracer
end