lib/ddtrace/contrib/httprb/instrumentation.rb in ddtrace-0.38.0 vs lib/ddtrace/contrib/httprb/instrumentation.rb in ddtrace-0.39.0
- old
+ new
@@ -80,15 +80,12 @@
span.set_tag(Datadog::Ext::HTTP::STATUS_CODE, response.code)
case response.code.to_i
when 400...599
- begin
- message = JSON.parse(response.body)['message']
- rescue
- message = 'Error'
- end
- span.set_error(["Error #{response.code}", message])
+ # https://github.com/DataDog/dd-trace-rb/issues/1116
+ # parsing the response body message will alter downstream application behavior
+ span.set_error(["Error #{response.code}", 'Error'])
end
end
def annotate_span_with_error!(span, error)
span.set_error(error)