diff --git a/sample-code/codeView.html b/sample-code/codeView.html index 85da1bc71..05266e794 100644 --- a/sample-code/codeView.html +++ b/sample-code/codeView.html @@ -162,6 +162,20 @@ public class XXXDBTracingDriver extends TracingDriver {
上下文将被存储在http request head,中,默认名称和SkyWalkingFilter保持一致。
如果服务端使用dubbox 2.8.4 的提供的http-rest,请使用方法重载
HttpClient httpclient = new SWTracingHttpClient(new DefaultHttpClient(), "Dubbo-Attachments");+ +
1.通过向全链路监控绑定业务字段。建立traceid和业务字段的对应关系,在调用链路中,可以直接展现业务字段信息。
+String businessKey = "phoneNumber:" + phoneNumber + ",resourceId:" + resourceId + ",mail:" + mail; +BusinessKeyAppender.setBusinessKey2Trace(businessKey);+
2.主动获取traceid,保存到应用程序数据库或其他存储中。
+Tracing.getTraceId();+ +
3.通过web应用的http调用入口,通过返回的header信息,找到此次调用的traceid。
+ +4.通过log4j或log4j2的扩展,在每行本地日志中,输出traceid。 +