support open-tracing
This commit is contained in:
parent
c9e90187cc
commit
7bf89427ab
|
|
@ -17,7 +17,7 @@ message RequestSpan {
|
|||
TraceId traceId = 1;
|
||||
string parentLevel = 2;
|
||||
int32 levelId = 3;
|
||||
int64 startDate = 4;
|
||||
int64 startTimestamp = 4;
|
||||
int32 routeKey = 5;
|
||||
map<string, string> tags = 6;
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ message Span {
|
|||
string parentLevelId=2;
|
||||
int32 levelId = 3;
|
||||
string viewpoint = 4;
|
||||
int64 startTime = 5;
|
||||
int64 startTimestamp = 5;
|
||||
int64 cost = 6;
|
||||
int32 statusCode = 7;
|
||||
string exceptionStack = 8;
|
||||
|
|
|
|||
|
|
@ -30,56 +30,62 @@
|
|||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-jedis-2.x-plugin</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-jdbc-plugin</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-httpClient-4.x-plugin</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>tomcat-7.x-8.x-plugin</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>motan-plugin</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- activation -->
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-toolkit-log4j-1.x-activation</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-toolkit-log4j-2.x-activation</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-toolkit-logback-1.x-activation</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-toolkit-trace-context-activation</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-toolkit-opentracing-activation</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@
|
|||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-health-report</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-logging-api</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lmax</groupId>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ public final class BusinessKeyAppender {
|
|||
|
||||
/**
|
||||
* 在当前埋点上下文中设置业务级信息
|
||||
*
|
||||
* @param businessKey
|
||||
*/
|
||||
public static void setBusinessKey2Trace(String businessKey) {
|
||||
|
||||
|
|
@ -27,4 +25,6 @@ public final class BusinessKeyAppender {
|
|||
}
|
||||
spanData.setBusinessKey(businessKey.substring(0, Config.BuriedPoint.BUSINESSKEY_MAX_LENGTH));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package com.a.eye.skywalking.api;
|
||||
|
||||
import com.a.eye.skywalking.context.CurrentThreadSpanStack;
|
||||
import com.a.eye.skywalking.model.ContextData;
|
||||
import com.a.eye.skywalking.model.RefContext;
|
||||
import com.a.eye.skywalking.model.Span;
|
||||
import com.a.eye.skywalking.network.grpc.TraceId;
|
||||
|
||||
import static com.a.eye.skywalking.util.TraceIdUtil.formatTraceId;
|
||||
|
||||
public class Tracing {
|
||||
public final class Tracing {
|
||||
/**
|
||||
* Get the traceId of current trace context.
|
||||
*
|
||||
|
|
@ -21,4 +20,35 @@ public class Tracing {
|
|||
|
||||
return formatTraceId(spanData.getTraceId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the current span of current trace.
|
||||
*
|
||||
* @return span. if it exists, or null
|
||||
*/
|
||||
public static Span getCurrentSpan() {
|
||||
Span spanData = CurrentThreadSpanStack.peek();
|
||||
return spanData;
|
||||
}
|
||||
|
||||
/**
|
||||
* the span will be tagged with the given key and value pair
|
||||
*
|
||||
* @param span
|
||||
* @param tagKey key of tag
|
||||
* @param tagValue value of tag
|
||||
*/
|
||||
public static void tag(Span span, String tagKey, String tagValue) {
|
||||
span.tag(tagKey, tagValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* init the ref context
|
||||
*
|
||||
* @param refContext ref context
|
||||
*/
|
||||
public static void initRefContext(RefContext refContext){
|
||||
CurrentThreadSpanStack.initRefContext(refContext);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
|
||||
|
||||
import com.a.eye.skywalking.model.RefContext;
|
||||
import com.a.eye.skywalking.model.Span;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -42,7 +43,20 @@ public class CurrentThreadSpanStack {
|
|||
return nodes.get().pop();
|
||||
}
|
||||
|
||||
public static void initRefContext(RefContext refContext) {
|
||||
if (nodes.get() == null){
|
||||
nodes.set(new SpanNodeStack());
|
||||
}
|
||||
nodes.get().initRefContext(refContext);
|
||||
}
|
||||
|
||||
static class SpanNodeStack {
|
||||
|
||||
/**
|
||||
* This {@link RefContext} contain the trace context from another processor.
|
||||
*/
|
||||
private RefContext refContext = null;
|
||||
|
||||
/**
|
||||
* The depth of call stack should less than 20, in most cases.
|
||||
* The depth is calculated by span, not class or the depth of java stack.
|
||||
|
|
@ -53,6 +67,8 @@ public class CurrentThreadSpanStack {
|
|||
Span span = spans.remove(getTopElementIdx()).getData();
|
||||
if (!isEmpty()) {
|
||||
spans.get(getTopElementIdx()).incrementNextSubSpanLevelId();
|
||||
}else{
|
||||
refContext = null;
|
||||
}
|
||||
return span;
|
||||
}
|
||||
|
|
@ -61,6 +77,12 @@ public class CurrentThreadSpanStack {
|
|||
if (!isEmpty()) {
|
||||
listPush(new SpanNode(span, spans.get(getTopElementIdx()).getNextSubSpanLevelId()));
|
||||
} else {
|
||||
if (refContext != null) {
|
||||
span.setTraceId(refContext.getTraceId());
|
||||
span.setParentLevel(refContext.getParentLevelId());
|
||||
span.setLevelId(0);
|
||||
}
|
||||
|
||||
listPush(new SpanNode(span));
|
||||
}
|
||||
|
||||
|
|
@ -85,6 +107,9 @@ public class CurrentThreadSpanStack {
|
|||
spans.add(spans.size(), spanNode);
|
||||
}
|
||||
|
||||
public void initRefContext(RefContext refContext) {
|
||||
this.refContext = refContext;
|
||||
}
|
||||
}
|
||||
|
||||
static class SpanNode {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.a.eye.skywalking.network.grpc.RequestSpan;
|
|||
import com.a.eye.skywalking.util.BuriedPointMachineUtil;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
|
|
@ -61,7 +62,7 @@ public abstract class BaseInvokeMonitor {
|
|||
*/
|
||||
protected void sendRequestSpan(Span span, Identification id) {
|
||||
RequestSpan requestSpan = SpanTagBuilder.newBuilder(span).setBusinessKey(id.getBusinessKey()).setSpanTypeDesc(id.getSpanTypeDesc()).setCallType(id.getCallType())
|
||||
.setProcessNo(BuriedPointMachineUtil.getProcessNo()).setAddress(BuriedPointMachineUtil.getHostDesc()).buildRequestSpan(RequestSpan.newBuilder());
|
||||
.setProcessNo(BuriedPointMachineUtil.getProcessNo()).setAddress(BuriedPointMachineUtil.getHostDesc()).setSpanType(span.getSpanType()).buildRequestSpan(RequestSpan.newBuilder());
|
||||
|
||||
RequestSpanDisruptor.INSTANCE.ready2Send(requestSpan);
|
||||
}
|
||||
|
|
@ -72,7 +73,7 @@ public abstract class BaseInvokeMonitor {
|
|||
* @param span
|
||||
*/
|
||||
protected void sendAckSpan(Span span) {
|
||||
AckSpan ackSpan = SpanTagBuilder.newBuilder(span).setStatusCode(span.getStatusCode()).setExceptionStack(span.getExceptionStack()).buildAckSpan(AckSpan.newBuilder());
|
||||
AckSpan ackSpan = SpanTagBuilder.newBuilder(span).setStatusCode(span.getStatusCode()).setExceptionStack(span.getExceptionStack()).setSpanType(span.getSpanType()).buildAckSpan(AckSpan.newBuilder());
|
||||
|
||||
AckSpanDisruptor.INSTANCE.ready2Send(ackSpan);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,17 @@ package com.a.eye.skywalking.model;
|
|||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
import com.a.eye.skywalking.util.StringUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Identification {
|
||||
private String viewPoint;
|
||||
private String businessKey;
|
||||
private String spanTypeDesc;
|
||||
private String callType;
|
||||
private long startTimestamp;
|
||||
private Map<String, String> tags = new HashMap<String, String>();
|
||||
|
||||
public Identification() {
|
||||
//Non
|
||||
|
|
@ -29,29 +35,39 @@ public class Identification {
|
|||
return businessKey;
|
||||
}
|
||||
|
||||
public long getStartTimestamp() {
|
||||
return startTimestamp;
|
||||
}
|
||||
|
||||
public Map<String, String> getTags() {
|
||||
if (tags == null){
|
||||
return Collections.EMPTY_MAP;
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
|
||||
public static IdentificationBuilder newBuilder() {
|
||||
return new IdentificationBuilder();
|
||||
}
|
||||
|
||||
public static class IdentificationBuilder {
|
||||
private Identification sendData;
|
||||
private Identification identification;
|
||||
|
||||
IdentificationBuilder() {
|
||||
sendData = new Identification();
|
||||
identification = new Identification();
|
||||
}
|
||||
|
||||
public Identification build() {
|
||||
return sendData;
|
||||
return identification;
|
||||
}
|
||||
|
||||
public IdentificationBuilder viewPoint(String viewPoint) {
|
||||
sendData.viewPoint = viewPoint;
|
||||
identification.viewPoint = viewPoint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IdentificationBuilder businessKey(String businessKey) {
|
||||
sendData.businessKey = businessKey;
|
||||
identification.businessKey = businessKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -59,11 +75,20 @@ public class Identification {
|
|||
if (StringUtil.isEmpty(spanType.getTypeName())) {
|
||||
throw new IllegalArgumentException("Span Type name cannot be null");
|
||||
}
|
||||
sendData.spanTypeDesc = spanType.getTypeName();
|
||||
sendData.callType = spanType.getCallType().toString();
|
||||
identification.spanTypeDesc = spanType.getTypeName();
|
||||
identification.callType = spanType.getCallType().toString();
|
||||
return this;
|
||||
}
|
||||
|
||||
public IdentificationBuilder startTime(long startTime) {
|
||||
identification.startTimestamp = startTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IdentificationBuilder tag(String tagKey, String tagValue) {
|
||||
identification.tags.put(tagKey, tagValue);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.a.eye.skywalking.model;
|
||||
|
||||
import com.a.eye.skywalking.network.grpc.TraceId;
|
||||
|
||||
/**
|
||||
* Created by xin on 2017/1/17.
|
||||
*/
|
||||
public class RefContext{
|
||||
private TraceId traceId;
|
||||
private String parentLevelId;
|
||||
|
||||
public RefContext(String contentDataStr) {
|
||||
ContextData contextData = new ContextData(contentDataStr);
|
||||
this.traceId = contextData.getTraceId();
|
||||
this.parentLevelId = contextData.getParentLevel();
|
||||
}
|
||||
|
||||
public TraceId getTraceId() {
|
||||
return traceId;
|
||||
}
|
||||
|
||||
public String getParentLevelId() {
|
||||
return parentLevelId;
|
||||
}
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ public class Span {
|
|||
/**
|
||||
* 节点调用开始时间
|
||||
*/
|
||||
protected long startDate = System.currentTimeMillis();
|
||||
protected long startTimestamp = System.currentTimeMillis();
|
||||
|
||||
/**
|
||||
* 节点调用的状态<br/>
|
||||
|
|
@ -87,7 +87,6 @@ public class Span {
|
|||
this.parentLevel = parentLevel;
|
||||
this.levelId = levelId;
|
||||
this.routeKey = routeKey;
|
||||
this.startDate = System.currentTimeMillis();
|
||||
|
||||
this.setTag(Tag.USER_NAME, Config.SkyWalking.USERNAME);
|
||||
this.setTag(Tag.APPLICATION_CODE, Config.SkyWalking.APPLICATION_CODE);
|
||||
|
|
@ -106,6 +105,10 @@ public class Span {
|
|||
this.parentLevel = parentLevel;
|
||||
}
|
||||
|
||||
public void setTraceId(TraceId traceId) {
|
||||
this.traceId = traceId;
|
||||
}
|
||||
|
||||
public int getLevelId() {
|
||||
return levelId;
|
||||
}
|
||||
|
|
@ -166,12 +169,12 @@ public class Span {
|
|||
|
||||
public RequestSpan.Builder buildRequestSpan(RequestSpan.Builder builder) {
|
||||
return builder.setTraceId(this.traceId).setParentLevel(this.parentLevel).setLevelId(this.levelId)
|
||||
.setStartDate(this.startDate).setRouteKey(routeKey).putAllTags(tags);
|
||||
.setStartTimestamp(this.startTimestamp).setRouteKey(routeKey).putAllTags(tags);
|
||||
}
|
||||
|
||||
public AckSpan.Builder buildAckSpan(AckSpan.Builder builder) {
|
||||
return builder.setTraceId(this.traceId).setParentLevel(this.parentLevel).setLevelId(this.levelId)
|
||||
.setCost(System.currentTimeMillis() - this.startDate).setRouteKey(routeKey).putAllTags(tags);
|
||||
.setCost(System.currentTimeMillis() - this.startTimestamp).setRouteKey(routeKey).putAllTags(tags);
|
||||
}
|
||||
|
||||
public int getRouteKey() {
|
||||
|
|
@ -197,4 +200,12 @@ public class Span {
|
|||
public String getExceptionStack() {
|
||||
return exceptionStack;
|
||||
}
|
||||
|
||||
public void tag(String key, String value) {
|
||||
tags.put(key, value);
|
||||
}
|
||||
|
||||
public void setStartTimestamp(long startTimestamp) {
|
||||
this.startTimestamp = startTimestamp;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ public class SpanTagBuilder {
|
|||
}
|
||||
|
||||
|
||||
public SpanTagBuilder setSpanType(int spanType) {
|
||||
span.setTag(Tag.SPAN_TYPE, spanType + "");
|
||||
public SpanTagBuilder setSpanType(String spanType) {
|
||||
span.setTag(Tag.SPAN_TYPE, spanType);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.a.eye.skywalking.model.ContextData;
|
|||
import com.a.eye.skywalking.model.Identification;
|
||||
import com.a.eye.skywalking.model.Span;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public final class ContextGenerator {
|
||||
/**
|
||||
* 利用本地ThreadLocal的信息创建Context,主要用于非跨JVM的操作
|
||||
|
|
@ -50,6 +52,12 @@ public final class ContextGenerator {
|
|||
span = new Span(parentSpan, id.getViewPoint());
|
||||
}
|
||||
|
||||
if (id.getStartTimestamp() != 0) {
|
||||
span.setStartTimestamp(id.getStartTimestamp());
|
||||
}
|
||||
for (Map.Entry<String, String> entry : id.getTags().entrySet()) {
|
||||
span.tag(entry.getKey(), entry.getValue());
|
||||
}
|
||||
return span;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,8 @@ package com.a.eye.skywalking.plugin.dubbo;
|
|||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
public class DubboBuriedPointType implements IBuriedPointType {
|
||||
|
||||
private static DubboBuriedPointType dubboBuriedPointType;
|
||||
|
||||
public static IBuriedPointType instance() {
|
||||
if (dubboBuriedPointType == null) {
|
||||
dubboBuriedPointType = new DubboBuriedPointType();
|
||||
}
|
||||
|
||||
return dubboBuriedPointType;
|
||||
}
|
||||
public enum DubboBuriedPointType implements IBuriedPointType {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
|
|
@ -24,8 +15,4 @@ public class DubboBuriedPointType implements IBuriedPointType {
|
|||
return CallType.SYNC;
|
||||
}
|
||||
|
||||
private DubboBuriedPointType() {
|
||||
//Non
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public class MonitorFilterInterceptor implements InstanceMethodsAroundIntercepto
|
|||
}
|
||||
|
||||
viewPoint.append(")");
|
||||
return Identification.newBuilder().viewPoint(viewPoint.toString()).spanType(DubboBuriedPointType.instance())
|
||||
return Identification.newBuilder().viewPoint(viewPoint.toString()).spanType(DubboBuriedPointType.INSTANCE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc
|
|||
.toString())
|
||||
.spanType(
|
||||
WebBuriedPointType
|
||||
.instance())
|
||||
.INSTANCE)
|
||||
.build()).toString());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,8 @@ package com.a.eye.skywalking.plugin.httpClient.v4;
|
|||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
public class WebBuriedPointType implements IBuriedPointType {
|
||||
|
||||
private static WebBuriedPointType webBuriedPointType;
|
||||
|
||||
public static IBuriedPointType instance() {
|
||||
if (webBuriedPointType == null) {
|
||||
webBuriedPointType = new WebBuriedPointType();
|
||||
}
|
||||
|
||||
return webBuriedPointType;
|
||||
}
|
||||
public enum WebBuriedPointType implements IBuriedPointType {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
|
|
@ -24,7 +15,4 @@ public class WebBuriedPointType implements IBuriedPointType {
|
|||
return CallType.SYNC;
|
||||
}
|
||||
|
||||
private WebBuriedPointType() {
|
||||
// Non
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class CallableStatementTracing {
|
|||
"callableStatement."
|
||||
+ method
|
||||
+ (sql == null || sql.length() == 0 ? ""
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.instance()).build());
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.INSTANCE).build());
|
||||
return exec.exe(realStatement, sql);
|
||||
} catch (SQLException e) {
|
||||
rpcClientInvokeMonitor.occurException(e);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class ConnectionTracing {
|
|||
"connection."
|
||||
+ method
|
||||
+ (sql == null || sql.length() == 0 ? ""
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.instance()).build());
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.INSTANCE).build());
|
||||
return exec.exe(realConnection, sql);
|
||||
} catch (SQLException e) {
|
||||
rpcClientInvokeMonitor.occurException(e);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class PreparedStatementTracing {
|
|||
"preaparedStatement."
|
||||
+ method
|
||||
+ (sql == null || sql.length() == 0 ? ""
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.instance()).build());
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.INSTANCE).build());
|
||||
return exec.exe(realStatement, sql);
|
||||
} catch (SQLException e) {
|
||||
rpcClientInvokeMonitor.occurException(e);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class StatementTracing {
|
|||
"statement."
|
||||
+ method
|
||||
+ (sql == null || sql.length() == 0 ? ""
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.instance()).build());
|
||||
: ":" + sql)).spanType(JDBCBuriedPointType.INSTANCE).build());
|
||||
return exec.exe(realStatement, sql);
|
||||
} catch (SQLException e) {
|
||||
rpcClientInvokeMonitor.occurException(e);
|
||||
|
|
|
|||
|
|
@ -2,18 +2,9 @@ package com.a.eye.skywalking.plugin.jdbc.define;
|
|||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
public class JDBCBuriedPointType implements IBuriedPointType {
|
||||
|
||||
private static JDBCBuriedPointType jdbcBuriedPointType;
|
||||
|
||||
public static IBuriedPointType instance() {
|
||||
if (jdbcBuriedPointType == null) {
|
||||
jdbcBuriedPointType = new JDBCBuriedPointType();
|
||||
}
|
||||
|
||||
return jdbcBuriedPointType;
|
||||
}
|
||||
public enum JDBCBuriedPointType implements IBuriedPointType {
|
||||
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
|
|
@ -25,7 +16,4 @@ public class JDBCBuriedPointType implements IBuriedPointType {
|
|||
return CallType.LOCAL;
|
||||
}
|
||||
|
||||
private JDBCBuriedPointType() {
|
||||
//Non
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class JedisMethodInterceptor extends SimpleObjectFirstInvokeInterceptor {
|
|||
.viewPoint(
|
||||
context.get(REDIS_CONN_INFO_KEY, String.class)
|
||||
+ " " + interceptorContext.methodName())
|
||||
.spanType(RedisBuriedPointType.instance());
|
||||
.spanType(RedisBuriedPointType.INSTANCE);
|
||||
if (interceptorContext.allArguments().length > 0
|
||||
&& interceptorContext.allArguments()[0] instanceof String) {
|
||||
builder.businessKey("key="
|
||||
|
|
|
|||
|
|
@ -2,17 +2,8 @@ package com.a.eye.skywalking.plugin.jedis.v2;
|
|||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
public class RedisBuriedPointType implements IBuriedPointType {
|
||||
private static RedisBuriedPointType redisBuriedPointType;
|
||||
|
||||
public static IBuriedPointType instance() {
|
||||
if (redisBuriedPointType == null) {
|
||||
redisBuriedPointType = new RedisBuriedPointType();
|
||||
}
|
||||
|
||||
return redisBuriedPointType;
|
||||
}
|
||||
|
||||
public enum RedisBuriedPointType implements IBuriedPointType {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
|
|
@ -24,5 +15,4 @@ public class RedisBuriedPointType implements IBuriedPointType {
|
|||
return CallType.SYNC;
|
||||
}
|
||||
|
||||
private RedisBuriedPointType(){}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,21 +2,13 @@ package com.a.eye.skywalking.plugin.motan;
|
|||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
public class MotanBuriedPointType implements IBuriedPointType {
|
||||
public enum MotanBuriedPointType implements IBuriedPointType {
|
||||
|
||||
private static MotanBuriedPointType motanBuriedPointType;
|
||||
|
||||
public static IBuriedPointType instance() {
|
||||
if (motanBuriedPointType == null) {
|
||||
motanBuriedPointType = new MotanBuriedPointType();
|
||||
}
|
||||
|
||||
return motanBuriedPointType;
|
||||
}
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "M";
|
||||
return "MO";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -24,8 +16,4 @@ public class MotanBuriedPointType implements IBuriedPointType {
|
|||
return CallType.SYNC;
|
||||
}
|
||||
|
||||
private MotanBuriedPointType() {
|
||||
//Non
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,19 +15,18 @@ import com.weibo.api.motan.rpc.URL;
|
|||
/**
|
||||
* Motan client interceptor
|
||||
*/
|
||||
public class MotanClientInterceptor implements InstanceMethodsAroundInterceptor, InstanceConstructorInterceptor {
|
||||
@Override
|
||||
public void onConstruct(EnhancedClassInstanceContext context, ConstructorInvokeContext interceptorContext) {
|
||||
context.set("serviceURI", interceptorContext.allArguments()[1]);
|
||||
}
|
||||
public class MotanClientCallInterceptor implements InstanceMethodsAroundInterceptor{
|
||||
|
||||
private static final String REQUEST_URL = "REQUEST_URL";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext,
|
||||
MethodInterceptResult result) {
|
||||
com.weibo.api.motan.rpc.Request request = (com.weibo.api.motan.rpc.Request) interceptorContext.allArguments()[0];
|
||||
if (request != null) {
|
||||
URL url = (URL) context.get(REQUEST_URL);
|
||||
Request request = (Request) interceptorContext.allArguments()[0];
|
||||
if (url != null) {
|
||||
ContextData contextData = new RPCClientInvokeMonitor()
|
||||
.beforeInvoke(generateIdentify(request, (com.weibo.api.motan.rpc.URL) context.get("serviceURI")));
|
||||
.beforeInvoke(generateIdentify(request, url));
|
||||
String contextDataStr = contextData.toString();
|
||||
request.setAttachment("contextData", contextDataStr);
|
||||
}
|
||||
|
|
@ -57,6 +56,6 @@ public class MotanClientInterceptor implements InstanceMethodsAroundInterceptor,
|
|||
|
||||
public static Identification generateIdentify(Request request, URL serviceURI) {
|
||||
return Identification.newBuilder().viewPoint(generateViewPoint(serviceURI, request))
|
||||
.spanType(MotanBuriedPointType.instance()).build();
|
||||
.spanType(MotanBuriedPointType.INSTANCE).build();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing;
|
||||
package com.a.eye.skywalking.plugin.motan;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
|
|
@ -6,17 +6,20 @@ import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInte
|
|||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
/**
|
||||
* Created by wusheng on 2017/1/3.
|
||||
* Created by xin on 2017/1/23.
|
||||
*/
|
||||
public class ExtractCrossProcessByteBufferContextInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
public class MotanClientFetchCallURLInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
private static final String REQUEST_URL = "REQUEST_URL";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
|
||||
context.set(REQUEST_URL, interceptorContext.allArguments()[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
return null;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -52,6 +52,6 @@ public class MotanServerInterceptor implements InstanceConstructorInterceptor, I
|
|||
|
||||
public static Identification generateIdentify(Request request, URL serviceURI) {
|
||||
return Identification.newBuilder().viewPoint(generateViewPoint(serviceURI, request))
|
||||
.spanType(MotanBuriedPointType.instance()).build();
|
||||
.spanType(MotanBuriedPointType.INSTANCE).build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,36 +3,36 @@ package com.a.eye.skywalking.plugin.motan.define;
|
|||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
public class MotanClientDefine extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
@Override
|
||||
protected String enhanceClassName() {
|
||||
return "com.weibo.api.motan.rpc.AbstractReferer";
|
||||
return "com.weibo.api.motan.cluster.support.ClusterSpi";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[] {new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return any();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return "com.a.eye.skywalking.plugin.motan.MotanClientInterceptor";
|
||||
}
|
||||
}};
|
||||
return new ConstructorInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[] {new InstanceMethodsInterceptPoint() {
|
||||
return new InstanceMethodsInterceptPoint[]{new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("setUrl");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.plugin.motan.MotanClientFetchCallURLInterceptor";
|
||||
}
|
||||
}, new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("call");
|
||||
|
|
@ -40,7 +40,7 @@ public class MotanClientDefine extends ClassInstanceMethodsEnhancePluginDefine {
|
|||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.plugin.motan.MotanClientInterceptor";
|
||||
return "com.a.eye.skywalking.plugin.motan.MotanClientCallInterceptor";
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class TomcatPluginInterceptor implements InstanceMethodsAroundInterceptor
|
|||
private Identification generateIdentification(HttpServletRequest request) {
|
||||
return Identification.newBuilder()
|
||||
.viewPoint(request.getRequestURL().toString())
|
||||
.spanType(WebBuriedPointType.instance())
|
||||
.spanType(WebBuriedPointType.INSTANCE)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,8 @@ package com.a.eye.skywalking.plugin.tomcat78x;
|
|||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
public class WebBuriedPointType implements IBuriedPointType {
|
||||
|
||||
private static WebBuriedPointType webBuriedPointType;
|
||||
|
||||
public static IBuriedPointType instance() {
|
||||
if (webBuriedPointType == null) {
|
||||
webBuriedPointType = new WebBuriedPointType();
|
||||
}
|
||||
|
||||
return webBuriedPointType;
|
||||
}
|
||||
public enum WebBuriedPointType implements IBuriedPointType {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
|
|
@ -24,7 +15,4 @@ public class WebBuriedPointType implements IBuriedPointType {
|
|||
return CallType.SYNC;
|
||||
}
|
||||
|
||||
private WebBuriedPointType() {
|
||||
// Non
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,16 @@
|
|||
|
||||
<artifactId>skywalking-toolkit-opentracing-activation</artifactId>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-toolkit-opentracing</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.span;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.noneOf;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
/**
|
||||
* Created by xin on 2017/1/16.
|
||||
*/
|
||||
public class SkyWalkingSpanActivation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
@Override
|
||||
protected String enhanceClassName() {
|
||||
return "com.a.eye.skywalking.toolkit.opentracing.SkyWalkingSpan";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[]{
|
||||
new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return takesArguments(String.class, long.class, Map.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor.SpanNewInstanceInterceptor";
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[]{
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("setTag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor.SpanSetTagInterceptor";
|
||||
}
|
||||
},
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("setOperationName");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor.SpanSetOperationNameInterceptor";
|
||||
}
|
||||
},
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("finish");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor.SpanFinishInterceptor";
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.api.Tracing;
|
||||
import com.a.eye.skywalking.invoke.monitor.LocalMethodInvokeMonitor;
|
||||
import com.a.eye.skywalking.model.Span;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by xin on 2017/1/16.
|
||||
*/
|
||||
public class SpanFinishInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
Span currentSpan = Tracing.getCurrentSpan();
|
||||
|
||||
Map<String, String> tags = (Map<String, String>) context.get("tags");
|
||||
if (tags != null) {
|
||||
for (Map.Entry<String, String> entry : tags.entrySet()) {
|
||||
Tracing.tag(currentSpan, entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
new LocalMethodInvokeMonitor().afterInvoke();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceConstructorInterceptor;
|
||||
|
||||
/**
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class SpanNewInstanceInterceptor implements InstanceConstructorInterceptor {
|
||||
|
||||
private static final String OPERATION_NAME = "operationName";
|
||||
|
||||
@Override
|
||||
public void onConstruct(EnhancedClassInstanceContext context, ConstructorInvokeContext interceptorContext) {
|
||||
context.set(OPERATION_NAME, interceptorContext.allArguments()[0]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing;
|
||||
package com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
|
|
@ -6,17 +6,20 @@ import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInte
|
|||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
/**
|
||||
* Created by wusheng on 2017/1/3.
|
||||
* Created by xin on 2017/1/16.
|
||||
*/
|
||||
public class ExtractCrossProcessTextMapContextInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
public class SpanSetOperationNameInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
private static final String OPERATION_NAME = "operationName";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
|
||||
context.set(OPERATION_NAME, interceptorContext.allArguments()[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
return null;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.span.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by xin on 2017/1/16.
|
||||
*/
|
||||
public class SpanSetTagInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
private static final String TAGS = "tags";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
Map<String, String> contextTags = (Map<String, String>) context.get(TAGS);
|
||||
if (!context.isContain(TAGS)){
|
||||
contextTags = new HashMap<String, String>();
|
||||
context.set(TAGS, contextTags);
|
||||
}
|
||||
|
||||
contextTags.put((String) interceptorContext.allArguments()[0], String.valueOf(interceptorContext
|
||||
.allArguments()[1]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder;
|
||||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
/**
|
||||
* @author zhangxin
|
||||
*/
|
||||
public enum OpenTracingLocalBuriedPointType implements IBuriedPointType {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "OT";
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallType getCallType() {
|
||||
return CallType.LOCAL;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
/**
|
||||
* Created by xin on 2017/1/16.
|
||||
*/
|
||||
public class SkyWalkingSpanBuilderActivation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
@Override
|
||||
protected String enhanceClassName() {
|
||||
return "com.a.eye.skywalking.toolkit.opentracing.SkyWalkingSpanBuilder";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[]{
|
||||
new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return takesArguments(String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor.SpanBuilderNewInstanceInterceptor";
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[]{
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("withTag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor.SpanBuilderWithTagInterceptor";
|
||||
}
|
||||
},
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("withStartTimestamp");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor.SpanBuilderWithStartTimeInterceptor";
|
||||
}
|
||||
},
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("start");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor.SpanBuilderStartInterceptor";
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceConstructorInterceptor;
|
||||
|
||||
public class SpanBuilderNewInstanceInterceptor implements InstanceConstructorInterceptor {
|
||||
|
||||
public static final String OPERATION_NAME = "operationName";
|
||||
|
||||
@Override
|
||||
public void onConstruct(EnhancedClassInstanceContext context, ConstructorInvokeContext interceptorContext) {
|
||||
context.set(OPERATION_NAME, interceptorContext.allArguments()[0]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.invoke.monitor.LocalMethodInvokeMonitor;
|
||||
import com.a.eye.skywalking.model.Identification;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.OpenTracingLocalBuriedPointType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class SpanBuilderStartInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
public static final String START_TIME = "startTimestamp";
|
||||
public static final String OPERATION_NAME = "operationName";
|
||||
public static final String TAGS = "tags";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
|
||||
Long startTime = fetchStartTime(context);
|
||||
String operationName = (String) context.get(OPERATION_NAME);
|
||||
Identification.IdentificationBuilder builder = Identification.newBuilder().viewPoint(operationName)
|
||||
.spanType(OpenTracingLocalBuriedPointType.INSTANCE);
|
||||
|
||||
if (startTime != null){
|
||||
builder.startTime(startTime);
|
||||
}
|
||||
|
||||
Map<String, String> tags = (Map<String, String>) context.get(TAGS);
|
||||
if (tags != null) {
|
||||
for (Map.Entry<String, String> tag : tags.entrySet()) {
|
||||
builder.tag(tag.getKey(), tag.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
new LocalMethodInvokeMonitor().beforeInvoke(builder.build());
|
||||
}
|
||||
|
||||
private Long fetchStartTime(EnhancedClassInstanceContext context) {
|
||||
Object startTime = context.get(START_TIME);
|
||||
if (startTime != null){
|
||||
return (Long) startTime;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing;
|
||||
package com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
|
|
@ -6,17 +6,20 @@ import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInte
|
|||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
/**
|
||||
* Created by wusheng on 2017/1/3.
|
||||
* Created by xin on 2017/1/16.
|
||||
*/
|
||||
public class FormatCrossProcessContextInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
public class SpanBuilderWithStartTimeInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
public static final String START_TIME = "startTimestamp";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
|
||||
context.set(START_TIME, interceptorContext.allArguments()[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
return null;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by xin on 2017/1/16.
|
||||
*/
|
||||
public class SpanBuilderWithTagInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
public static final String TAGS = "tags";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
Map<String, String> contextTags = (Map<String, String>) context.get(TAGS);
|
||||
if (!context.isContain(TAGS)){
|
||||
contextTags = new HashMap<String, String>();
|
||||
context.set(TAGS, contextTags);
|
||||
}
|
||||
|
||||
contextTags.put((String) interceptorContext.allArguments()[0], String.valueOf(interceptorContext
|
||||
.allArguments()[1]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing;
|
||||
package com.a.eye.skywalking.toolkit.activation.opentracing.tracer;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
|
|
@ -36,7 +36,7 @@ public class SkyWalkingTracerActivation extends ClassInstanceMethodsEnhancePlugi
|
|||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.FormatCrossProcessContextInterceptor";
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.tracer.interceptor.TracerFormatCrossProcessContextInterceptor";
|
||||
}
|
||||
}, new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
|
|
@ -46,7 +46,7 @@ public class SkyWalkingTracerActivation extends ClassInstanceMethodsEnhancePlugi
|
|||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.ExtractCrossProcessTextMapContextInterceptor";
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.tracer.interceptor.TracerExtractCrossProcessTextMapContextInterceptor";
|
||||
}
|
||||
}, new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
|
|
@ -56,7 +56,7 @@ public class SkyWalkingTracerActivation extends ClassInstanceMethodsEnhancePlugi
|
|||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.ExtractCrossProcessByteBufferContextInterceptor";
|
||||
return "com.a.eye.skywalking.toolkit.activation.opentracing.tracer.interceptor.TracerExtractCrossProcessByteBufferContextInterceptor";
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.tracer.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.api.Tracing;
|
||||
import com.a.eye.skywalking.model.RefContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class TracerExtractCrossProcessByteBufferContextInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
ByteBuffer byteBuffer = (ByteBuffer) interceptorContext.allArguments()[0];
|
||||
String contextDataStr = new String(byteBuffer.array(), Charset.forName("UTF-8"));
|
||||
Tracing.initRefContext(new RefContext(contextDataStr));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.tracer.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.api.Tracing;
|
||||
import com.a.eye.skywalking.model.RefContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import io.opentracing.propagation.TextMap;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class TracerExtractCrossProcessTextMapContextInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
|
||||
public static final String SKY_WALKING_TRACING_NAME = "SkyWalking-TRACING-NAME";
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
TextMap textMap = (TextMap) interceptorContext.allArguments()[0];
|
||||
Iterator<Map.Entry<String, String>> iterator = textMap.iterator();
|
||||
while (iterator.hasNext()){
|
||||
Map.Entry<String, String> entry = iterator.next();
|
||||
if (SKY_WALKING_TRACING_NAME.equals(entry.getKey())){
|
||||
try {
|
||||
Tracing.initRefContext(new RefContext(entry.getValue()));
|
||||
}catch (Throwable e){
|
||||
// do something
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.a.eye.skywalking.toolkit.activation.opentracing.tracer.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.api.Tracing;
|
||||
import com.a.eye.skywalking.model.ContextData;
|
||||
import com.a.eye.skywalking.model.Span;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.a.eye.skywalking.toolkit.opentracing.SkyWalkingTracer;
|
||||
|
||||
/**
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class TracerFormatCrossProcessContextInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
@Override
|
||||
public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) {
|
||||
Span span = Tracing.getCurrentSpan();
|
||||
if (span != null) {
|
||||
return new ContextData(span.getTraceId(), generateSubParentLevelId(span), span.getRouteKey()).toString();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
|
||||
}
|
||||
|
||||
private String generateSubParentLevelId(Span spanData) {
|
||||
if (spanData.getParentLevel() == null || spanData.getParentLevel().length() == 0) {
|
||||
return spanData.getLevelId() + "";
|
||||
}
|
||||
|
||||
return spanData.getParentLevel() + "." + spanData.getLevelId();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
com.a.eye.skywalking.toolkit.activation.opentracing.span.SkyWalkingSpanActivation
|
||||
com.a.eye.skywalking.toolkit.activation.opentracing.spanbuilder.SkyWalkingSpanBuilderActivation
|
||||
com.a.eye.skywalking.toolkit.activation.opentracing.tracer.SkyWalkingTracerActivation
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-util</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- nano httpd -->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class RequestSpanModule {
|
|||
return null;
|
||||
}
|
||||
return RequestSpan.newBuilder().putAllTags(tags).setLevelId(levelId).setParentLevel(parentLevelId)
|
||||
.setRouteKey(routeKey).setStartDate(startTime).setTraceId(TraceIdUtil.toTraceId(traceId)).build();
|
||||
.setRouteKey(routeKey).setStartTimestamp(startTime).setTraceId(TraceIdUtil.toTraceId(traceId)).build();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class RequestSpanData extends AbstractSpanData {
|
|||
}
|
||||
|
||||
public long getStartTime() {
|
||||
return requestSpan.getStartDate();
|
||||
return requestSpan.getStartTimestamp();
|
||||
}
|
||||
|
||||
public String getBusinessKey() {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class SpanDataHelper {
|
|||
}
|
||||
|
||||
builder = builder.setLevelId(requestSpanData.getLevelId()).setParentLevelId(requestSpanData.getParentLevelId()).setProcessNo(requestSpanData.getProcessNo())
|
||||
.setSpanType(requestSpanData.getType()).setSpanTypeDesc(requestSpanData.getSpanTypeDesc()).setStartTime(requestSpanData.getStartTime())
|
||||
.setSpanType(requestSpanData.getType()).setSpanTypeDesc(requestSpanData.getSpanTypeDesc()).setStartTimestamp(requestSpanData.getStartTime())
|
||||
.setStatusCode(ackSpanData.getStatusCode())
|
||||
.setViewpoint(requestSpanData.getViewPoint())
|
||||
.setTraceId(TraceId.newBuilder().addAllSegments(Arrays.asList(requestSpanData.getTraceIdSegments())));
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class StorageThread extends Thread {
|
|||
.putTags(Tag.ADDRESS.toString(), NetUtils.getLocalAddress().toString())
|
||||
.putTags(Tag.APPLICATION_CODE.toString(), "1")
|
||||
.putTags(Tag.CALL_TYPE.toString(), "1").setLevelId(0)
|
||||
.putTags(Tag.PROCESS_NO.toString(), "19287").setStartDate(System.currentTimeMillis())
|
||||
.putTags(Tag.PROCESS_NO.toString(), "19287").setStartTimestamp(System.currentTimeMillis())
|
||||
.setTraceId(TraceId.newBuilder().addSegments(201611).addSegments(value).addSegments(8504828).addSegments(2277).addSegments(53).addSegments(3).build())
|
||||
.putTags(Tag.USER_NAME.toString(), "1").putTags(Tag.VIEW_POINT.toString(), "http://localhost:8080/wwww/test/helloWorld").setRouteKey(i).build();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,22 +20,22 @@
|
|||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-network</artifactId>
|
||||
<version>2.1-2017</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-logging-api</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-logging-impl-log4j2</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-registry</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class FullSpan {
|
|||
this.businessKey = span.getBusinessKey();
|
||||
this.spanTypeDesc = span.getSpanTypeDesc();
|
||||
this.username = span.getUsername();
|
||||
this.startDate = span.getStartTime();
|
||||
this.startDate = span.getStartTimestamp();
|
||||
this.viewPointId = span.getViewpoint();
|
||||
this.spanType = span.getSpanType() + "";
|
||||
this.address = span.getAddress();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ public class Constants {
|
|||
put("D", "DUBBO");
|
||||
put("L", "LOCAL");
|
||||
put("U", "UNKNOWN");
|
||||
put("MO", "Motan");
|
||||
put("OT", "OpenTracing");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue