We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
客户端: TraceContentFactory#buildTraceContent 异步获取MDC.getCopyOfContextMap(); 导致这个线程无法获取到id,因此只有服务名加入Map<String, String> traceContentMap进行发送。
TraceContentFactory#buildTraceContent
Map<String, String> traceContentMap
服务端: 客户端异步发送只发送了服务名称,导致TraceContentFactory#storageMDC 方法重新生成id, // "ParentName" 根据 headerTraceId 判断为空 赋值为 this
TraceContentFactory#storageMDC
headerTraceId
this
public static void storageMDC(Map<String, String> traceContentMap) { String headerTraceId = traceContentMap.get(Constants.LEGACY_TRACE_ID_NAME); log.debug("Trace traceId {}", headerTraceId); // 如果为空,则表示第一次访问,即上游服务端的请求 if (StringUtils.isEmpty(headerTraceId)) { MDC.put(Constants.LEGACY_TRACE_ID_NAME, TraceIdUtil.traceIdString()); } else { MDC.put(Constants.LEGACY_TRACE_ID_NAME, headerTraceId); } // "ParentName" String headerParentName = traceContentMap.get(Constants.LEGACY_PARENT_SERVICE_NAME); if (StringUtils.isEmpty(headerTraceId)) { MDC.put(Constants.LEGACY_PARENT_SERVICE_NAME, "this"); } else { MDC.put(Constants.LEGACY_PARENT_SERVICE_NAME, headerParentName); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
客户端:
TraceContentFactory#buildTraceContent
异步获取MDC.getCopyOfContextMap();导致这个线程无法获取到id,因此只有服务名加入
Map<String, String> traceContentMap
进行发送。服务端:
客户端异步发送只发送了服务名称,导致
TraceContentFactory#storageMDC
方法重新生成id,// "ParentName" 根据
headerTraceId
判断为空 赋值为this
The text was updated successfully, but these errors were encountered: