From 7ae894e9d685b6de4444c6a52071735c541f528a Mon Sep 17 00:00:00 2001 From: wusheng Date: Tue, 22 Dec 2015 16:19:46 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0traced=E7=9A=84=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E7=BB=91=E5=AE=9A=E8=AF=B4=E6=98=8E=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample-code/codeView.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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");
+ +

+ 能通过哪些渠道在应用中发现traceid? +

+

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。 +