fix: Prevent OpenCensus integration from getting out of sync on upload commands
This commit is contained in:
1 parent
e3e97668b4
commit
29f9544b14
2 files changed
+20
-8
No files matched your search
@@ -385,14 +385,16 @@ module Google
|
||||
return unless @opencensus_span
|
||||
return unless OpenCensus::Trace.span_context
|
||||
|
||||
if @http_res.body.respond_to? :bytesize
|
||||
@opencensus_span.put_message_event \
|
||||
OpenCensus::Trace::SpanBuilder::RECEIVED, 1, @http_res.body.bytesize
|
||||
end
|
||||
status = @http_res.status.to_i
|
||||
if status > 0
|
||||
@opencensus_span.set_status map_http_status status
|
||||
@opencensus_span.put_attribute "http.status_code", status
|
||||
if @http_res
|
||||
if @http_res.body.respond_to? :bytesize
|
||||
@opencensus_span.put_message_event \
|
||||
OpenCensus::Trace::SpanBuilder::RECEIVED, 1, @http_res.body.bytesize
|
||||
end
|
||||
status = @http_res.status.to_i
|
||||
if status > 0
|
||||
@opencensus_span.set_status map_http_status status
|
||||
@opencensus_span.put_attribute "http.status_code", status
|
||||
end
|
||||
end
|
||||
|
||||
OpenCensus::Trace.end_span @opencensus_span
|
||||
|
||||
Reference in new issue
Block a user