Adjust some service.
This commit is contained in:
parent
b7c09d56f9
commit
e09741c832
|
|
@ -10,6 +10,11 @@ service TraceSegmentService {
|
|||
}
|
||||
}
|
||||
|
||||
message UpstreamSegment {
|
||||
repeated string globalTraceIds = 1;
|
||||
bytes segment = 2; // the byte array of TraceSegmentObject
|
||||
}
|
||||
|
||||
message TraceSegmentObject {
|
||||
string traceSegmentId = 1;
|
||||
repeated TraceSegmentReference refs = 2;
|
||||
|
|
@ -22,8 +27,8 @@ message TraceSegmentObject {
|
|||
message TraceSegmentReference {
|
||||
string parentTraceSegmentId = 1;
|
||||
int32 parentSpanId = 2;
|
||||
repeated int32 serviceChains = 3;
|
||||
int32 parentApplicationId = 4;
|
||||
int32 parentApplicationId = 3;
|
||||
string networkAddress = 4;
|
||||
int32 networkAddressId = 5;
|
||||
}
|
||||
|
||||
|
|
@ -33,13 +38,14 @@ message SpanObject {
|
|||
int64 startTime = 3;
|
||||
int64 endTime = 4;
|
||||
int32 operationNameId = 5;
|
||||
int32 peerNetworkAddressId = 6;
|
||||
SpanType spanType = 7;
|
||||
SpanLayer spanLayer = 8;
|
||||
string component = 9;
|
||||
bool isError = 10;
|
||||
repeated KeyValue tags = 11;
|
||||
repeated LogMessage logs = 12;
|
||||
int32 peerId = 6;
|
||||
string peer = 7;
|
||||
SpanType spanType = 8;
|
||||
SpanLayer spanLayer = 9;
|
||||
string component = 10;
|
||||
bool isError = 11;
|
||||
repeated KeyValue tags = 12;
|
||||
repeated LogMessage logs = 13;
|
||||
}
|
||||
|
||||
enum SpanType {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package org.skywalking.apm.agent.core.context.component;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
*/
|
||||
public abstract class AbstractComponent {
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
protected AbstractComponent(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,21 +38,7 @@ public final class Tags {
|
|||
private static final String HTTP_LAYER = "http";
|
||||
private static final String MQ_LAYER = "mq";
|
||||
|
||||
public static void asDB(AbstractSpan span) {
|
||||
SPAN_LAYER_TAG.set(span, DB_LAYER);
|
||||
}
|
||||
|
||||
public static void asRPCFramework(AbstractSpan span) {
|
||||
SPAN_LAYER_TAG.set(span, RPC_FRAMEWORK_LAYER);
|
||||
}
|
||||
|
||||
public static void asHttp(AbstractSpan span) {
|
||||
SPAN_LAYER_TAG.set(span, HTTP_LAYER);
|
||||
}
|
||||
|
||||
public static void asMQ(AbstractSpan span) {
|
||||
SPAN_LAYER_TAG.set(span, MQ_LAYER);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ package org.skywalking.apm.agent.core.context.trace;
|
|||
* @author wusheng
|
||||
*/
|
||||
public interface AbstractSpan {
|
||||
void setLayer(SpanLayer layer);
|
||||
|
||||
/**
|
||||
* Set a key:value tag on the Span.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.skywalking.apm.agent.core.context.trace;
|
|||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import org.skywalking.apm.agent.core.context.component.AbstractComponent;
|
||||
import org.skywalking.apm.agent.core.context.util.KeyValuePair;
|
||||
import org.skywalking.apm.agent.core.context.util.ThrowableTransformer;
|
||||
import org.skywalking.apm.agent.core.dictionary.DictionaryUtil;
|
||||
|
|
@ -18,6 +19,7 @@ public abstract class AbstractTracingSpan implements AbstractSpan {
|
|||
protected List<KeyValuePair> tags;
|
||||
protected String operationName;
|
||||
protected int operationId;
|
||||
protected SpanLayer layer;
|
||||
/**
|
||||
* The start time of this Span.
|
||||
*/
|
||||
|
|
@ -31,6 +33,8 @@ public abstract class AbstractTracingSpan implements AbstractSpan {
|
|||
*/
|
||||
protected boolean errorOccurred = false;
|
||||
|
||||
protected int componentId = 0;
|
||||
|
||||
/**
|
||||
* Log is a concept from OpenTracing spec.
|
||||
* <p>
|
||||
|
|
@ -113,4 +117,13 @@ public abstract class AbstractTracingSpan implements AbstractSpan {
|
|||
public int getOperationId() {
|
||||
return operationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayer(SpanLayer layer) {
|
||||
this.layer = layer;
|
||||
}
|
||||
|
||||
public void setComponent(AbstractComponent component){
|
||||
this.componentId = component.getId();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package org.skywalking.apm.agent.core.context.trace;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
*/
|
||||
public enum SpanLayer {
|
||||
DB,
|
||||
RPC_FRAMEWORK,
|
||||
HTTP,
|
||||
MQ;
|
||||
|
||||
public static void asDB(AbstractSpan span) {
|
||||
span.setLayer(SpanLayer.DB);
|
||||
}
|
||||
|
||||
public static void asRPCFramework(AbstractSpan span) {
|
||||
span.setLayer(SpanLayer.RPC_FRAMEWORK);
|
||||
}
|
||||
|
||||
public static void asHttp(AbstractSpan span) {
|
||||
span.setLayer(SpanLayer.HTTP);
|
||||
}
|
||||
|
||||
public static void asMQ(AbstractSpan span) {
|
||||
span.setLayer(SpanLayer.MQ);
|
||||
}
|
||||
}
|
||||
|
|
@ -6,5 +6,5 @@ package org.skywalking.apm.agent.core.context.trace;
|
|||
public enum SpanType {
|
||||
ENTRY,
|
||||
EXIT,
|
||||
LOCAL;
|
||||
LOCAL
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue