lib/opentelemetry/instrumentation/aws_sdk/handler.rb in opentelemetry-instrumentation-aws_sdk-0.2.0 vs lib/opentelemetry/instrumentation/aws_sdk/handler.rb in opentelemetry-instrumentation-aws_sdk-0.2.1
- old
+ new
@@ -35,9 +35,12 @@
if instrumentation_config[:suppress_internal_instrumentation]
OpenTelemetry::Common::Utilities.untraced { super }
else
super
end.tap do |response|
+ span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE,
+ context.http_response.status_code)
+
if (err = response.error)
span.record_exception(err)
span.status = Trace::Status.error(err.to_s)
end
end