未验证 提交 c8187ccd 编写于 作者: 静夜思朝颜's avatar 静夜思朝颜 提交者: GitHub

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: NMrproliu <mrproliu@lagou.com>
Co-authored-by: wu-sheng's avatar吴晟 Wu Sheng <wu.sheng@foxmail.com>
上级 dcd66ee6
......@@ -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(
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册