lib/instana/instrumentation/rack.rb in instana-0.14.0 vs lib/instana/instrumentation/rack.rb in instana-0.14.2
- old
+ new
@@ -28,9 +28,15 @@
status, headers, response = @app.call(env)
if ::Instana.tracer.tracing?
kvs[:http][:status] = status
+ if status.between?(500, 511)
+ # Because of the 5xx response, we flag this span as errored but
+ # without a backtrace (no exception)
+ ::Instana.tracer.log_error(nil)
+ end
+
# Save the IDs before the trace ends so we can place
# them in the response headers in the ensure block
trace_id = ::Instana.tracer.trace_id
span_id = ::Instana.tracer.span_id
end