Skip to content

Commit

Permalink
add trace level logs for span compressed spans
Browse files Browse the repository at this point in the history
  • Loading branch information
jackshirazi committed Jul 10, 2023
1 parent 71bbdf7 commit 3da2d3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ public final void end(long epochMicros) {
try {
if (bufferedSpan.compareAndSet(buffered, null)) {
this.tracer.endSpan(buffered);
logger.trace("span compression buffer was set to null and {} was ended", buffered);
}
} finally {
buffered.decrementReferences();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ protected void afterEnd() {
if (parentBuffered != null) {
if (parent.bufferedSpan.compareAndSet(parentBuffered, null)) {
this.tracer.endSpan(parentBuffered);
logger.trace("parent span compression buffer was set to null and {} was ended", parentBuffered);
}
}
this.tracer.endSpan(this);
Expand All @@ -292,6 +293,8 @@ protected void afterEnd() {
// but we're dropping the compression attempt to keep things simple and avoid looping so this stays wait-free
// this doesn't exactly diverge from the spec, but it can lead to non-optimal compression under high load
this.tracer.endSpan(this);
} else {
logger.trace("parent span compression buffer was set to {}", this);
}
return;
}
Expand All @@ -300,6 +303,7 @@ protected void afterEnd() {
// we couldn't compress so replace the buffer with this
if (parent.bufferedSpan.compareAndSet(parentBuffered, this)) {
this.tracer.endSpan(parentBuffered);
logger.trace("parent span compression buffer was set to {} and {} was ended", this, parentBuffered);
} else {
// the failed update would ideally lead to a compression attempt with the new buffer,
// but we're dropping the compression attempt to keep things simple and avoid looping so this stays wait-free
Expand Down

0 comments on commit 3da2d3b

Please sign in to comment.