diff --git a/README.md b/README.md
index e1fde2118..11244e738 100644
--- a/README.md
+++ b/README.md
@@ -1,94 +1,60 @@
Sky Walking
==========
-
+
-SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, also known Distributed Tracer.
+**SkyWalking 3.x**: APM for Distributed Systems, also known Distributed Tracing System.
[](https://travis-ci.org/wu-sheng/sky-walking)
-[](https://coveralls.io/github/wu-sheng/sky-walking?branch=master)
+[](https://coveralls.io/github/wu-sheng/sky-walking?branch=master)

[](https://codebeat.co/projects/github-com-wu-sheng-sky-walking)
[](https://gitter.im/sky-walking/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](http://opentracing.io)
-[](https://github.com/wu-sheng/sky-walking/releases)
-
-# News
-* sky-walking v3.0 iteration begins... The top 2 important features are: [`Update the trace-structure`](https://github.com/wu-sheng/sky-walking/issues/83) and [`Analyze trace, and bring metric/analytic/cause up`](https://github.com/wu-sheng/sky-walking/issues/84)
-* See feature codes at [branch feature/3.0](https://github.com/wu-sheng/sky-walking/tree/feature/3.0)
-* The new UI release on [wu-sheng/sky-walking-ui](https://github.com/wu-sheng/sky-walking-ui)
-
-# Abstract
-* An open source Large-Scale Distributed Systems Tracing Infrastructure, also known a ditributed tracer.
-* Based on [Google Dapper Paper: Dapper, a Large-Scale Distributed Systems Tracing Infrastructure](http://research.google.com/pubs/pub36356.html), read [Simplified Chinese Version](http://duanple.blog.163.com/blog/static/70971767201329113141336/)
-* Support popular rpc frameworks, such as [dubbo](https://github.com/alibaba/dubbo), [dubbox](https://github.com/dangdangdotcom/dubbox), [motan](https://github.com/weibocom/motan) etc., trigger email-alert when application occurs unexpected exception.
-* Auto-instrumentation mechenism, **no need to CHANGE any application source code**.
-* Easy to deploy, **even in product mode** (since 2.0) . No need of Hadoop, HBase, or Cassandra Cluster.
-* Pure Java server implementation. provide HTTP (since 2.1) cross-platform spans collecting service.
-* High performance stream process.
+[](https://github.com/wu-sheng/sky-walking/releases)
-# Supported components
-
-### web containers
-* Tomcat 7
-* Tomcat 8
-
-### databases
-* mysql
-* oracle
-* h2
-* easily extend to support sybase, sqlserver, jtds, db2, informix
-
-### rpc frameworks
-* dubbo
-* dubbox
-* httpClient
-* motan
-
-### cache
-* jedis
-
-### opentracing supported frameworks
-* motan
-* hprose-java
-
-# Contributors
-* 吴晟 [wusheng](https://github.com/wu-sheng) wu.sheng@foxmail.com
-* 张鑫 [zhangxin](https://github.com/ascrutae)
-
-
-_Chinese Articles about sky-walking and distributed tracer_
-
-
-
-_If you are Chinese Developer, you can join QQ Group: 392443393, and **Tagged** Sky-Walking._
+* Auto-instrumentation mechanism, **no need to CHANGE any application source code**. Supported [frameworks](https://github.com/wu-sheng/sky-walking/wiki/3.0-supported-list).
+* Pure Java server implementation, with RESTful Web service.
+* High performance streaming analysis.
+* The UI released on [wu-sheng/sky-walking-ui](https://github.com/wu-sheng/sky-walking-ui)
___
-
+
In October 2016, Sky Walking won `OneAPM Open Source Achievement Award`. The award appreciates sky walking for its "*contribution to popularization of APM technology*".
-[OneAPM](http://www.oneapm.com/) will provide financial support for the project in 2016-2017.
+[OneAPM](http://www.oneapm.com/) provides financial support for the project in 2016-2017.
Thanks all users of sky walking project.
___
+# Contributors
+_In chronological order_
+* 吴晟 [@wu-sheng](https://github.com/wu-sheng)
+* 张鑫 [@ascrutae](https://github.com/ascrutae)
+* 谭真 [@mircoteam](https://github.com/mircoteam)
+* 徐妍 [@TastySummer](https://github.com/TastySummer)
+* 彭勇升 [@pengys5](https://github.com/pengys5)
+* 戴文
-# Quick View
-* distributed trace
-
+# Screenshots
+- Topological graph of application clusters.
+
-
+- Trace query.
+
-
+- Span detail.
+
-* alarm mail
-
-
# Document
* [WIKI](https://github.com/wu-sheng/sky-walking/wiki)
+
+_Chat with us on gitter, in English. As a Chinese Developer, you can join QQ Group: 392443393, and **Tagged** Sky-Walking._
+
+_sky-walking 1.x and 2.x provide features about tracing only, did not include any analysis abilities._
diff --git a/docs/donate.jpg b/docs/donate.jpg
deleted file mode 100644
index d739d34ed..000000000
Binary files a/docs/donate.jpg and /dev/null differ
diff --git a/docs/resources/SkyWalkingArch.jpg b/docs/resources/SkyWalkingArch.jpg
deleted file mode 100644
index d63fadade..000000000
Binary files a/docs/resources/SkyWalkingArch.jpg and /dev/null differ
diff --git a/docs/resources/alarmMail.png b/docs/resources/alarmMail.png
deleted file mode 100644
index 0e62fdcf0..000000000
Binary files a/docs/resources/alarmMail.png and /dev/null differ
diff --git a/docs/resources/callChain.png b/docs/resources/callChain.png
deleted file mode 100644
index 8be0fa7f2..000000000
Binary files a/docs/resources/callChain.png and /dev/null differ
diff --git a/docs/resources/callChainDetail.png b/docs/resources/callChainDetail.png
deleted file mode 100644
index 06297c610..000000000
Binary files a/docs/resources/callChainDetail.png and /dev/null differ
diff --git a/docs/resources/callChainLog.png b/docs/resources/callChainLog.png
deleted file mode 100644
index 05a42fe9f..000000000
Binary files a/docs/resources/callChainLog.png and /dev/null differ
diff --git a/docs/resources/demo-application-cluster-tracer.jpg b/docs/resources/demo-application-cluster-tracer.jpg
deleted file mode 100644
index 8be0fa7f2..000000000
Binary files a/docs/resources/demo-application-cluster-tracer.jpg and /dev/null differ
diff --git a/docs/resources/oneapm-award.png b/docs/resources/oneapm-award.png
deleted file mode 100644
index 142ae190e..000000000
Binary files a/docs/resources/oneapm-award.png and /dev/null differ
diff --git a/docs/resources/skywalking.png b/docs/resources/skywalking.png
deleted file mode 100644
index 3e26a5766..000000000
Binary files a/docs/resources/skywalking.png and /dev/null differ
diff --git a/docs/resources/skywalking_ot.png b/docs/resources/skywalking_ot.png
deleted file mode 100644
index 37be52ced..000000000
Binary files a/docs/resources/skywalking_ot.png and /dev/null differ
diff --git a/docs/resources/toutiao.JPG b/docs/resources/toutiao.JPG
deleted file mode 100644
index 533a2f521..000000000
Binary files a/docs/resources/toutiao.JPG and /dev/null differ
diff --git a/pom.xml b/pom.xml
index a10be42bd..2445e2397 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,6 +24,21 @@
Zhang Xin
https://github.com/ascrutae
+
+ Tan Zhen
+ https://github.com/mircoteam
+
+
+ Xu Yan
+ https://github.com/TastySummer
+
+
+ Peng Yongsheng
+ https://github.com/pengys5
+
+
+ Dai Wen
+
diff --git a/skywalking-application-toolkit/skywalking-toolkit-opentracing/src/main/java/com/a/eye/skywalking/toolkit/opentracing/SkyWalkingSpanBuilder.java b/skywalking-application-toolkit/skywalking-toolkit-opentracing/src/main/java/com/a/eye/skywalking/toolkit/opentracing/SkyWalkingSpanBuilder.java
index 15cc19d21..e5a3ca5d5 100644
--- a/skywalking-application-toolkit/skywalking-toolkit-opentracing/src/main/java/com/a/eye/skywalking/toolkit/opentracing/SkyWalkingSpanBuilder.java
+++ b/skywalking-application-toolkit/skywalking-toolkit-opentracing/src/main/java/com/a/eye/skywalking/toolkit/opentracing/SkyWalkingSpanBuilder.java
@@ -94,6 +94,9 @@ public class SkyWalkingSpanBuilder implements Tracer.SpanBuilder {
@Override
public Span start() {
+ if (startTime == 0){
+ startTime = System.currentTimeMillis();
+ }
return new SkyWalkingSpan(this.operationName, this.startTime, this.tags);
}
diff --git a/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceId/DistributedTraceId.java b/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceId/DistributedTraceId.java
index b64cffaea..9730a55a6 100644
--- a/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceId/DistributedTraceId.java
+++ b/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceId/DistributedTraceId.java
@@ -24,6 +24,13 @@ public abstract class DistributedTraceId {
return id;
}
+ /**
+ * Compare the two DistributedTraceId by its {@link #id},
+ * even these two DistributedTraceIds are not the same instances.
+ *
+ * @param o target DistributedTraceId
+ * @return return if they have the same {@link #id}
+ */
@Override
public boolean equals(Object o) {
if (this == o)
diff --git a/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceSegment.java b/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceSegment.java
index 75e11cdcb..65a8aae22 100644
--- a/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceSegment.java
+++ b/skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceSegment.java
@@ -100,8 +100,7 @@ public class TraceSegment {
private boolean sampled;
/**
- * Create a trace segment, by given segmentId.
- * This segmentId is generated by TraceSegmentRef, AKA, from tracer/agent module.
+ * Create a trace segment, by the given applicationCode.
*/
public TraceSegment(String applicationCode) {
this();
@@ -109,7 +108,9 @@ public class TraceSegment {
}
/**
- * Create a default/empty trace segment
+ * Create a default/empty trace segment,
+ * with current time as start time,
+ * and generate a new segment id.
*/
public TraceSegment() {
this.startTime = System.currentTimeMillis();
@@ -134,6 +135,11 @@ public class TraceSegment {
}
}
+ /**
+ * Establish the line between this segment and all relative global trace ids.
+ *
+ * @param distributedTraceIds multi global trace ids. @see {@link DistributedTraceId}
+ */
public void relatedGlobalTraces(List distributedTraceIds) {
if (distributedTraceIds == null || distributedTraceIds.size() == 0) {
return;
diff --git a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/client/CollectorClient.java b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/client/CollectorClient.java
index b77f95625..18a36f86e 100644
--- a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/client/CollectorClient.java
+++ b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/client/CollectorClient.java
@@ -30,15 +30,11 @@ import org.apache.http.impl.client.HttpClients;
public class CollectorClient implements Runnable {
private static ILog logger = LogManager.getLogger(CollectorClient.class);
private static long SLEEP_TIME_MILLIS = 500;
- private CloseableHttpClient httpclient;
private String[] serverList;
private volatile int selectedServer = -1;
public CollectorClient() {
serverList = Config.Collector.SERVERS.split(",");
- httpclient = HttpClients.custom()
- .setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy())
- .build();
Random r = new Random();
if (serverList.length > 0) {
selectedServer = r.nextInt(serverList.length);
@@ -92,11 +88,11 @@ public class CollectorClient implements Runnable {
.excludeFieldsWithoutExposeAnnotation()
.create();
String messageJson = gson.toJson(message);
-
+ CloseableHttpClient httpClient = HttpClients.custom().build();
try {
HttpPost httpPost = ready2Send(messageJson);
if (httpPost != null) {
- CloseableHttpResponse httpResponse = httpclient.execute(httpPost);
+ CloseableHttpResponse httpResponse = httpClient.execute(httpPost);
int statusCode = httpResponse.getStatusLine().getStatusCode();
if (200 != statusCode) {
findBackupServer();
@@ -106,6 +102,8 @@ public class CollectorClient implements Runnable {
} catch (IOException e) {
findBackupServer();
throw e;
+ }finally {
+ httpClient.close();
}
}
diff --git a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/ContextManager.java b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/ContextManager.java
index 1fe799d4a..107c2856b 100644
--- a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/ContextManager.java
+++ b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/ContextManager.java
@@ -1,7 +1,6 @@
package com.a.eye.skywalking.api.context;
import com.a.eye.skywalking.api.boot.BootService;
-import com.a.eye.skywalking.api.queue.TraceSegmentProcessQueue;
import com.a.eye.skywalking.trace.Span;
import com.a.eye.skywalking.trace.TraceSegment;
@@ -44,21 +43,14 @@ public class ContextManager implements TracerContextListener, BootService {
}
/**
- * @see {@link TracerContext#extract(ContextCarrier)}
+ * @return the first global trace id if exist. Otherwise, "N/A".
*/
- public static void multiExtract(ContextCarrier carrier){
- get().extract(carrier);
- }
-
- /**
- * @return the {@link TraceSegment#traceSegmentId} if exist. Otherwise, "N/A".
- */
- public static String getTraceSegmentId(){
+ public static String getGlobalTraceId(){
TracerContext segment = CONTEXT.get();
if(segment == null){
return "N/A";
}else{
- return segment.getTraceSegmentId();
+ return segment.getGlobalTraceId();
}
}
diff --git a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/TracerContext.java b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/TracerContext.java
index 2485ee92d..c5e218e43 100644
--- a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/TracerContext.java
+++ b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/api/context/TracerContext.java
@@ -91,10 +91,10 @@ public final class TracerContext {
}
/**
- * @return the current trace segment id.
+ * @return the current trace id.
*/
- String getTraceSegmentId(){
- return segment.getTraceSegmentId();
+ String getGlobalTraceId(){
+ return segment.getRelatedGlobalTraces().get(0).get();
}
public void stopSpan(Span span, Long endTime){
diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v1/x/PrintTraceIdInterceptor.java b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v1/x/PrintTraceIdInterceptor.java
index 917a57e77..d2a6325cf 100644
--- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v1/x/PrintTraceIdInterceptor.java
+++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v1/x/PrintTraceIdInterceptor.java
@@ -1,6 +1,5 @@
package com.a.eye.skywalking.toolkit.activation.log.log4j.v1.x;
-import com.a.eye.skywalking.api.context.ContextCarrier;
import com.a.eye.skywalking.api.context.ContextManager;
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodInvokeContext;
@@ -26,7 +25,7 @@ public class PrintTraceIdInterceptor implements InstanceMethodsAroundInterceptor
*/
@Override
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
- return "TID:" + ContextManager.getTraceSegmentId();
+ return "TID:" + ContextManager.getGlobalTraceId();
}
@Override
diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v2/x/PrintTraceIdInterceptor.java b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v2/x/PrintTraceIdInterceptor.java
index 3ced73776..2612e9421 100644
--- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v2/x/PrintTraceIdInterceptor.java
+++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-2.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/log4j/v2/x/PrintTraceIdInterceptor.java
@@ -1,6 +1,5 @@
package com.a.eye.skywalking.toolkit.activation.log.log4j.v2.x;
-import com.a.eye.skywalking.api.context.ContextCarrier;
import com.a.eye.skywalking.api.context.ContextManager;
import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInterceptResult;
import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInvokeContext;
@@ -19,7 +18,7 @@ public class PrintTraceIdInterceptor implements StaticMethodsAroundInterceptor {
*/
@Override
public void beforeMethod(StaticMethodInvokeContext interceptorContext, MethodInterceptResult result) {
- ((StringBuilder) interceptorContext.allArguments()[0]).append("TID:" + ContextManager.getTraceSegmentId());
+ ((StringBuilder) interceptorContext.allArguments()[0]).append("TID:" + ContextManager.getGlobalTraceId());
//make sure origin method do not invoke.
result.defineReturnValue(null);
diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/logback/v1/x/PrintTraceIdInterceptor.java b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/logback/v1/x/PrintTraceIdInterceptor.java
index afa630192..ee74753bd 100644
--- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/logback/v1/x/PrintTraceIdInterceptor.java
+++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-logback-1.x-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/log/logback/v1/x/PrintTraceIdInterceptor.java
@@ -25,7 +25,7 @@ public class PrintTraceIdInterceptor implements InstanceMethodsAroundInterceptor
*/
@Override
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
- return "TID:" + ContextManager.getTraceSegmentId();
+ return "TID:" + ContextManager.getGlobalTraceId();
}
@Override
diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/trace/TraceContextInterceptor.java b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/trace/TraceContextInterceptor.java
index 938d0e249..168deee7e 100644
--- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/trace/TraceContextInterceptor.java
+++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/src/main/java/com/a/eye/skywalking/toolkit/activation/trace/TraceContextInterceptor.java
@@ -1,6 +1,5 @@
package com.a.eye.skywalking.toolkit.activation.trace;
-import com.a.eye.skywalking.api.context.ContextCarrier;
import com.a.eye.skywalking.api.context.ContextManager;
import com.a.eye.skywalking.logging.ILog;
import com.a.eye.skywalking.logging.LogManager;
@@ -24,7 +23,7 @@ public class TraceContextInterceptor implements StaticMethodsAroundInterceptor {
@Override
public Object afterMethod(StaticMethodInvokeContext interceptorContext, Object ret) {
- return ContextManager.getTraceSegmentId();
+ return ContextManager.getGlobalTraceId();
}
@Override