Fix profile trace not match when change the entry operationId/Name (#4528)

* Fix profile trace not match when change the entry operationId/Name

* Update TracingContext.java

Co-authored-by: Mrproliu <mrproliu@lagou.com>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
mrproliu 2020-03-17 12:39:58 +08:00 committed by GitHub
parent dcd66ee6e9
commit c8187ccd41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -353,6 +353,11 @@ public class TracingContext implements AbstractTracerContext {
final AbstractSpan parentSpan = peek();
final int parentSpanId = parentSpan == null ? -1 : parentSpan.getSpanId();
if (parentSpan != null && parentSpan.isEntry()) {
/**
* Only add the profiling recheck on creating entry span,
* as the operation name could be overrided.
*/
profilingRecheck(parentSpan, operationName);
entrySpan = (AbstractTracingSpan) DictionaryManager.findEndpointSection()
.findOnly(segment.getServiceId(), operationName)
.doInCondition(

View File

@ -212,9 +212,6 @@ public abstract class AbstractTracingSpan implements AbstractSpan {
public AbstractTracingSpan setOperationName(String operationName) {
this.operationName = operationName;
this.operationId = DictionaryUtil.nullValue();
// recheck profiling status
owner.profilingRecheck(this, operationName);
return this;
}