Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1516,15 +1516,13 @@ public BlobAppendableUpload blobAppendableUpload(
try (Scope ignore = span.makeCurrent()) {

return new OtelDecoratingBlobAppendableUpload(
delegate.blobAppendableUpload(blobInfo, uploadConfig, options));
delegate.blobAppendableUpload(blobInfo, uploadConfig, options), span);

} catch (Throwable t) {
span.recordException(t);
span.setStatus(StatusCode.ERROR, t.getClass().getSimpleName());
span.end();
throw t;
} finally {
span.end();
}
}

Expand Down Expand Up @@ -2110,10 +2108,12 @@ public String toString() {

final class OtelDecoratingBlobAppendableUpload implements BlobAppendableUpload {
private final BlobAppendableUpload delegate;
private final Span uploadSpan;
private final Tracer tracer;

private OtelDecoratingBlobAppendableUpload(BlobAppendableUpload delegate) {
private OtelDecoratingBlobAppendableUpload(BlobAppendableUpload delegate, Span uploadSpan) {
this.delegate = delegate;
this.uploadSpan = uploadSpan;
this.tracer =
TracerDecorator.decorate(
Context.current(),
Expand Down Expand Up @@ -2159,9 +2159,12 @@ public void finalizeAndClose() throws IOException {
} catch (IOException | RuntimeException e) {
openSpan.recordException(e);
openSpan.setStatus(StatusCode.ERROR, e.getClass().getSimpleName());
uploadSpan.recordException(e);
uploadSpan.setStatus(StatusCode.ERROR, e.getClass().getSimpleName());
throw e;
} finally {
openSpan.end();
uploadSpan.end();
}
}

Expand All @@ -2173,9 +2176,12 @@ public void closeWithoutFinalizing() throws IOException {
} catch (IOException | RuntimeException e) {
openSpan.recordException(e);
openSpan.setStatus(StatusCode.ERROR, e.getClass().getSimpleName());
uploadSpan.recordException(e);
uploadSpan.setStatus(StatusCode.ERROR, e.getClass().getSimpleName());
throw e;
} finally {
openSpan.end();
uploadSpan.end();
}
}

Expand All @@ -2187,9 +2193,12 @@ public void close() throws IOException {
} catch (IOException | RuntimeException e) {
openSpan.recordException(e);
openSpan.setStatus(StatusCode.ERROR, e.getClass().getSimpleName());
uploadSpan.recordException(e);
uploadSpan.setStatus(StatusCode.ERROR, e.getClass().getSimpleName());
throw e;
} finally {
openSpan.end();
uploadSpan.end();
}
}

Expand Down
Loading