diff --git a/skywalking-collector/skywalking-agent/pom.xml b/skywalking-collector/skywalking-agent/pom.xml
index c37d2e744..d53b263fb 100644
--- a/skywalking-collector/skywalking-agent/pom.xml
+++ b/skywalking-collector/skywalking-agent/pom.xml
@@ -21,6 +21,8 @@
com.ai.cloud.skywalking.api.dependencies.net.bytebuddy
io.netty
com.ai.cloud.skywalking.api.dependencies.io.netty
+ com.google.protobuf
+ com.ai.cloud.skywalking.api.dependencies.google.protobuf
@@ -82,6 +84,10 @@
${shade.io.netty.source}
${shade.io.netty.target}
+
+ ${shade.com.google.protobuf.source}
+ ${shade.com.google.protobuf.target}
+
diff --git a/skywalking-collector/skywalking-protocol/pom.xml b/skywalking-collector/skywalking-protocol/pom.xml
index 100d57dfb..d0c2956d8 100644
--- a/skywalking-collector/skywalking-protocol/pom.xml
+++ b/skywalking-collector/skywalking-protocol/pom.xml
@@ -18,6 +18,12 @@
+
+ com.google.protobuf
+ protobuf-java
+ 2.6.1
+
+
junit
junit
@@ -28,6 +34,25 @@
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.9.1
+
+
+ add-source
+ generate-sources
+
+ add-source
+
+
+
+ ${project.basedir}/src/main/gen-java
+
+
+
+
+
org.apache.maven.plugins
maven-resources-plugin
@@ -51,6 +76,36 @@
2.4
+
+ maven-antrun-plugin
+
+
+ compile-protoc
+ generate-sources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ src/main/gen-java
+
+
+ run
+
+
+
+
diff --git a/skywalking-collector/skywalking-protocol/src/main/gen-java/com/ai/cloud/skywalking/protocol/proto/AckSpanProtobuf.java b/skywalking-collector/skywalking-protocol/src/main/gen-java/com/ai/cloud/skywalking/protocol/proto/AckSpanProtobuf.java
new file mode 100644
index 000000000..25f1d2d8a
--- /dev/null
+++ b/skywalking-collector/skywalking-protocol/src/main/gen-java/com/ai/cloud/skywalking/protocol/proto/AckSpanProtobuf.java
@@ -0,0 +1,1100 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: AckSpanProtobuf.proto
+
+package com.ai.cloud.skywalking.protocol.proto;
+
+public final class AckSpanProtobuf {
+ private AckSpanProtobuf() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface AckSpanOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:AckSpan)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * required string traceId = 1;
+ */
+ boolean hasTraceId();
+ /**
+ * required string traceId = 1;
+ */
+ java.lang.String getTraceId();
+ /**
+ * required string traceId = 1;
+ */
+ com.google.protobuf.ByteString
+ getTraceIdBytes();
+
+ /**
+ * optional string parentLevel = 2;
+ */
+ boolean hasParentLevel();
+ /**
+ * optional string parentLevel = 2;
+ */
+ java.lang.String getParentLevel();
+ /**
+ * optional string parentLevel = 2;
+ */
+ com.google.protobuf.ByteString
+ getParentLevelBytes();
+
+ /**
+ * optional int32 levelId = 3;
+ */
+ boolean hasLevelId();
+ /**
+ * optional int32 levelId = 3;
+ */
+ int getLevelId();
+
+ /**
+ * required int64 cost = 4;
+ */
+ boolean hasCost();
+ /**
+ * required int64 cost = 4;
+ */
+ long getCost();
+
+ /**
+ * required int32 statusCode = 5;
+ */
+ boolean hasStatusCode();
+ /**
+ * required int32 statusCode = 5;
+ */
+ int getStatusCode();
+
+ /**
+ * optional string exceptionStack = 6;
+ */
+ boolean hasExceptionStack();
+ /**
+ * optional string exceptionStack = 6;
+ */
+ java.lang.String getExceptionStack();
+ /**
+ * optional string exceptionStack = 6;
+ */
+ com.google.protobuf.ByteString
+ getExceptionStackBytes();
+ }
+ /**
+ * Protobuf type {@code AckSpan}
+ */
+ public static final class AckSpan extends
+ com.google.protobuf.GeneratedMessage implements
+ // @@protoc_insertion_point(message_implements:AckSpan)
+ AckSpanOrBuilder {
+ // Use AckSpan.newBuilder() to construct.
+ private AckSpan(com.google.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private AckSpan(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final AckSpan defaultInstance;
+ public static AckSpan getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public AckSpan getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private AckSpan(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000001;
+ traceId_ = bs;
+ break;
+ }
+ case 18: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000002;
+ parentLevel_ = bs;
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000004;
+ levelId_ = input.readInt32();
+ break;
+ }
+ case 32: {
+ bitField0_ |= 0x00000008;
+ cost_ = input.readInt64();
+ break;
+ }
+ case 40: {
+ bitField0_ |= 0x00000010;
+ statusCode_ = input.readInt32();
+ break;
+ }
+ case 50: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000020;
+ exceptionStack_ = bs;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.internal_static_AckSpan_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.internal_static_AckSpan_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan.class, com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser PARSER =
+ new com.google.protobuf.AbstractParser() {
+ public AckSpan parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new AckSpan(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ public static final int TRACEID_FIELD_NUMBER = 1;
+ private java.lang.Object traceId_;
+ /**
+ * required string traceId = 1;
+ */
+ public boolean hasTraceId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required string traceId = 1;
+ */
+ public java.lang.String getTraceId() {
+ java.lang.Object ref = traceId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ traceId_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * required string traceId = 1;
+ */
+ public com.google.protobuf.ByteString
+ getTraceIdBytes() {
+ java.lang.Object ref = traceId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ traceId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int PARENTLEVEL_FIELD_NUMBER = 2;
+ private java.lang.Object parentLevel_;
+ /**
+ * optional string parentLevel = 2;
+ */
+ public boolean hasParentLevel() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * optional string parentLevel = 2;
+ */
+ public java.lang.String getParentLevel() {
+ java.lang.Object ref = parentLevel_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ parentLevel_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * optional string parentLevel = 2;
+ */
+ public com.google.protobuf.ByteString
+ getParentLevelBytes() {
+ java.lang.Object ref = parentLevel_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parentLevel_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int LEVELID_FIELD_NUMBER = 3;
+ private int levelId_;
+ /**
+ * optional int32 levelId = 3;
+ */
+ public boolean hasLevelId() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * optional int32 levelId = 3;
+ */
+ public int getLevelId() {
+ return levelId_;
+ }
+
+ public static final int COST_FIELD_NUMBER = 4;
+ private long cost_;
+ /**
+ * required int64 cost = 4;
+ */
+ public boolean hasCost() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * required int64 cost = 4;
+ */
+ public long getCost() {
+ return cost_;
+ }
+
+ public static final int STATUSCODE_FIELD_NUMBER = 5;
+ private int statusCode_;
+ /**
+ * required int32 statusCode = 5;
+ */
+ public boolean hasStatusCode() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * required int32 statusCode = 5;
+ */
+ public int getStatusCode() {
+ return statusCode_;
+ }
+
+ public static final int EXCEPTIONSTACK_FIELD_NUMBER = 6;
+ private java.lang.Object exceptionStack_;
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public boolean hasExceptionStack() {
+ return ((bitField0_ & 0x00000020) == 0x00000020);
+ }
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public java.lang.String getExceptionStack() {
+ java.lang.Object ref = exceptionStack_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ exceptionStack_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public com.google.protobuf.ByteString
+ getExceptionStackBytes() {
+ java.lang.Object ref = exceptionStack_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ exceptionStack_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ traceId_ = "";
+ parentLevel_ = "";
+ levelId_ = 0;
+ cost_ = 0L;
+ statusCode_ = 0;
+ exceptionStack_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasTraceId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasCost()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasStatusCode()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getTraceIdBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, getParentLevelBytes());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeInt32(3, levelId_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeInt64(4, cost_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ output.writeInt32(5, statusCode_);
+ }
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ output.writeBytes(6, getExceptionStackBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getTraceIdBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, getParentLevelBytes());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(3, levelId_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(4, cost_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt32Size(5, statusCode_);
+ }
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(6, getExceptionStackBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code AckSpan}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder implements
+ // @@protoc_insertion_point(builder_implements:AckSpan)
+ com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpanOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.internal_static_AckSpan_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.internal_static_AckSpan_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan.class, com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan.Builder.class);
+ }
+
+ // Construct using com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ traceId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ parentLevel_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ levelId_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ cost_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ statusCode_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000010);
+ exceptionStack_ = "";
+ bitField0_ = (bitField0_ & ~0x00000020);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.internal_static_AckSpan_descriptor;
+ }
+
+ public com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan getDefaultInstanceForType() {
+ return com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan.getDefaultInstance();
+ }
+
+ public com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan build() {
+ com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan buildPartial() {
+ com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan result = new com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.traceId_ = traceId_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.parentLevel_ = parentLevel_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.levelId_ = levelId_;
+ if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ result.cost_ = cost_;
+ if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ result.statusCode_ = statusCode_;
+ if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+ to_bitField0_ |= 0x00000020;
+ }
+ result.exceptionStack_ = exceptionStack_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan) {
+ return mergeFrom((com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan other) {
+ if (other == com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan.getDefaultInstance()) return this;
+ if (other.hasTraceId()) {
+ bitField0_ |= 0x00000001;
+ traceId_ = other.traceId_;
+ onChanged();
+ }
+ if (other.hasParentLevel()) {
+ bitField0_ |= 0x00000002;
+ parentLevel_ = other.parentLevel_;
+ onChanged();
+ }
+ if (other.hasLevelId()) {
+ setLevelId(other.getLevelId());
+ }
+ if (other.hasCost()) {
+ setCost(other.getCost());
+ }
+ if (other.hasStatusCode()) {
+ setStatusCode(other.getStatusCode());
+ }
+ if (other.hasExceptionStack()) {
+ bitField0_ |= 0x00000020;
+ exceptionStack_ = other.exceptionStack_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasTraceId()) {
+
+ return false;
+ }
+ if (!hasCost()) {
+
+ return false;
+ }
+ if (!hasStatusCode()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (com.ai.cloud.skywalking.protocol.proto.AckSpanProtobuf.AckSpan) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private java.lang.Object traceId_ = "";
+ /**
+ * required string traceId = 1;
+ */
+ public boolean hasTraceId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required string traceId = 1;
+ */
+ public java.lang.String getTraceId() {
+ java.lang.Object ref = traceId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ traceId_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * required string traceId = 1;
+ */
+ public com.google.protobuf.ByteString
+ getTraceIdBytes() {
+ java.lang.Object ref = traceId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ traceId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * required string traceId = 1;
+ */
+ public Builder setTraceId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ traceId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required string traceId = 1;
+ */
+ public Builder clearTraceId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ traceId_ = getDefaultInstance().getTraceId();
+ onChanged();
+ return this;
+ }
+ /**
+ * required string traceId = 1;
+ */
+ public Builder setTraceIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ traceId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object parentLevel_ = "";
+ /**
+ * optional string parentLevel = 2;
+ */
+ public boolean hasParentLevel() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * optional string parentLevel = 2;
+ */
+ public java.lang.String getParentLevel() {
+ java.lang.Object ref = parentLevel_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ parentLevel_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * optional string parentLevel = 2;
+ */
+ public com.google.protobuf.ByteString
+ getParentLevelBytes() {
+ java.lang.Object ref = parentLevel_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parentLevel_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * optional string parentLevel = 2;
+ */
+ public Builder setParentLevel(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ parentLevel_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * optional string parentLevel = 2;
+ */
+ public Builder clearParentLevel() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ parentLevel_ = getDefaultInstance().getParentLevel();
+ onChanged();
+ return this;
+ }
+ /**
+ * optional string parentLevel = 2;
+ */
+ public Builder setParentLevelBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ parentLevel_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int levelId_ ;
+ /**
+ * optional int32 levelId = 3;
+ */
+ public boolean hasLevelId() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * optional int32 levelId = 3;
+ */
+ public int getLevelId() {
+ return levelId_;
+ }
+ /**
+ * optional int32 levelId = 3;
+ */
+ public Builder setLevelId(int value) {
+ bitField0_ |= 0x00000004;
+ levelId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * optional int32 levelId = 3;
+ */
+ public Builder clearLevelId() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ levelId_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private long cost_ ;
+ /**
+ * required int64 cost = 4;
+ */
+ public boolean hasCost() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * required int64 cost = 4;
+ */
+ public long getCost() {
+ return cost_;
+ }
+ /**
+ * required int64 cost = 4;
+ */
+ public Builder setCost(long value) {
+ bitField0_ |= 0x00000008;
+ cost_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required int64 cost = 4;
+ */
+ public Builder clearCost() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ cost_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private int statusCode_ ;
+ /**
+ * required int32 statusCode = 5;
+ */
+ public boolean hasStatusCode() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * required int32 statusCode = 5;
+ */
+ public int getStatusCode() {
+ return statusCode_;
+ }
+ /**
+ * required int32 statusCode = 5;
+ */
+ public Builder setStatusCode(int value) {
+ bitField0_ |= 0x00000010;
+ statusCode_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required int32 statusCode = 5;
+ */
+ public Builder clearStatusCode() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ statusCode_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object exceptionStack_ = "";
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public boolean hasExceptionStack() {
+ return ((bitField0_ & 0x00000020) == 0x00000020);
+ }
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public java.lang.String getExceptionStack() {
+ java.lang.Object ref = exceptionStack_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ exceptionStack_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public com.google.protobuf.ByteString
+ getExceptionStackBytes() {
+ java.lang.Object ref = exceptionStack_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ exceptionStack_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public Builder setExceptionStack(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ exceptionStack_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public Builder clearExceptionStack() {
+ bitField0_ = (bitField0_ & ~0x00000020);
+ exceptionStack_ = getDefaultInstance().getExceptionStack();
+ onChanged();
+ return this;
+ }
+ /**
+ * optional string exceptionStack = 6;
+ */
+ public Builder setExceptionStackBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ exceptionStack_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:AckSpan)
+ }
+
+ static {
+ defaultInstance = new AckSpan(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:AckSpan)
+ }
+
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_AckSpan_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_AckSpan_fieldAccessorTable;
+
+ public static com.google.protobuf.Descriptors.FileDescriptor
+ getDescriptor() {
+ return descriptor;
+ }
+ private static com.google.protobuf.Descriptors.FileDescriptor
+ descriptor;
+ static {
+ java.lang.String[] descriptorData = {
+ "\n\025AckSpanProtobuf.proto\"z\n\007AckSpan\022\017\n\007tr" +
+ "aceId\030\001 \002(\t\022\023\n\013parentLevel\030\002 \001(\t\022\017\n\007leve" +
+ "lId\030\003 \001(\005\022\014\n\004cost\030\004 \002(\003\022\022\n\nstatusCode\030\005 " +
+ "\002(\005\022\026\n\016exceptionStack\030\006 \001(\tB(\n&com.ai.cl" +
+ "oud.skywalking.protocol.proto"
+ };
+ com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
+ new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
+ public com.google.protobuf.ExtensionRegistry assignDescriptors(
+ com.google.protobuf.Descriptors.FileDescriptor root) {
+ descriptor = root;
+ return null;
+ }
+ };
+ com.google.protobuf.Descriptors.FileDescriptor
+ .internalBuildGeneratedFileFrom(descriptorData,
+ new com.google.protobuf.Descriptors.FileDescriptor[] {
+ }, assigner);
+ internal_static_AckSpan_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_AckSpan_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_AckSpan_descriptor,
+ new java.lang.String[] { "TraceId", "ParentLevel", "LevelId", "Cost", "StatusCode", "ExceptionStack", });
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/AckSpan.java b/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/AckSpan.java
index 16a8c63ca..15508b3a3 100644
--- a/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/AckSpan.java
+++ b/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/AckSpan.java
@@ -2,6 +2,9 @@ package com.ai.cloud.skywalking.protocol;
import com.ai.cloud.skywalking.protocol.common.AbstractDataSerializable;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Created by wusheng on 16/7/4.
*/
@@ -19,11 +22,11 @@ public class AckSpan extends AbstractDataSerializable {
* 当前调用链的本机描述
* 如当前序号为:0.1.0时,levelId=0
*/
- private int levelId = 0;
+ private int levelId = 0;
/**
* 节点调用花费时间
*/
- private long cost = 0L;
+ private long cost = 0L;
/**
* 节点调用的状态
* 0:成功
@@ -37,6 +40,7 @@ public class AckSpan extends AbstractDataSerializable {
*/
private String exceptionStack;
+
public AckSpan(Span spanData) {
this.traceId = spanData.getTraceId();
this.parentLevel = spanData.getParentLevel();
@@ -46,6 +50,11 @@ public class AckSpan extends AbstractDataSerializable {
this.exceptionStack = spanData.getExceptionStack();
}
+ /**
+ * 埋点入参列表,补充时触发
+ */
+ private Map paramters = new HashMap();
+
public String getTraceId() {
return traceId;
}
@@ -94,6 +103,14 @@ public class AckSpan extends AbstractDataSerializable {
this.exceptionStack = exceptionStack;
}
+ public Map getParamters() {
+ return paramters;
+ }
+
+ public void setParamters(Map paramters) {
+ this.paramters = paramters;
+ }
+
@Override
public int getDataType() {
return 2;
diff --git a/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/RequestSPan.java b/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/RequestSPan.java
index 7a71d5305..dcb024ee6 100644
--- a/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/RequestSPan.java
+++ b/skywalking-collector/skywalking-protocol/src/main/java/com/ai/cloud/skywalking/protocol/RequestSPan.java
@@ -76,6 +76,9 @@ public class RequestSpan extends AbstractDataSerializable {
*/
private String userId;
+ /**
+ * 埋点入参列表
+ */
private Map paramters = new HashMap();
public RequestSpan(Span spanData) {
diff --git a/skywalking-collector/skywalking-protocol/src/main/proto/AckSpanProtobuf.proto b/skywalking-collector/skywalking-protocol/src/main/proto/AckSpanProtobuf.proto
new file mode 100644
index 000000000..200e87a35
--- /dev/null
+++ b/skywalking-collector/skywalking-protocol/src/main/proto/AckSpanProtobuf.proto
@@ -0,0 +1,13 @@
+syntax="proto2";
+
+option java_package = "com.ai.cloud.skywalking.protocol.proto";
+
+message AckSpan{
+ required string traceId = 1;
+ optional string parentLevel = 2;
+ optional int32 levelId = 3;
+ required int64 cost = 4;
+ required int32 statusCode = 5;
+ optional string exceptionStack = 6;
+
+}
diff --git a/skywalking-collector/skywalking-sdk-plugin/pom.xml b/skywalking-collector/skywalking-sdk-plugin/pom.xml
index 78806644f..c99ea31cc 100644
--- a/skywalking-collector/skywalking-sdk-plugin/pom.xml
+++ b/skywalking-collector/skywalking-sdk-plugin/pom.xml
@@ -28,6 +28,7 @@
+
com.ai.cloud
skywalking-test-api