lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-rack-0.18.0 vs lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-rack-0.19.0
- old
+ new
@@ -151,10 +151,10 @@
request_uri_or_path_info
end
end
def set_attributes_after_request(span, status, headers, _response)
- span.status = OpenTelemetry::Trace::Status.http_to_status(status)
+ span.status = OpenTelemetry::Trace::Status.error unless (100..399).include?(status.to_i)
span.set_attribute('http.status_code', status)
# NOTE: if data is available, it would be good to do this:
# set_attribute('http.route', ...
# e.g., "/users/:userID?