Support set operation name in async mode span (#4015)

This commit is contained in:
cyejing 2019-12-11 14:20:31 +08:00 committed by 吴晟 Wu Sheng
parent cfb3379cd0
commit 31a6407feb
2 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ public class EntrySpan extends StackBasedTracingSpan {
@Override
public AbstractTracingSpan setOperationName(String operationName) {
if (stackDepth == currentMaxDepth) {
if (stackDepth == currentMaxDepth || isInAsyncMode) {
return super.setOperationName(operationName);
} else {
return this;

View File

@ -116,7 +116,7 @@ public class ExitSpan extends StackBasedTracingSpan implements WithPeerInfo {
@Override
public AbstractTracingSpan setOperationName(String operationName) {
if (stackDepth == 1) {
if (stackDepth == 1 || isInAsyncMode) {
return super.setOperationName(operationName);
} else {
return this;