diff --git a/skywalking-network/pom.xml b/skywalking-network/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..762bf18c2c1e3174a0c9363b68a2bf9e182aa794 --- /dev/null +++ b/skywalking-network/pom.xml @@ -0,0 +1,155 @@ + + + com.a.eye + 2.0-2016 + 4.0.0 + + skywalking-network + + + UTF-8 + + com.google + com.a.eye.skywalking.network.dependencies.com.google + + io.grpc + com.a.eye.skywalking.network.dependencies.io.grpc + + io.netty + com.a.eye.skywalking.network.dependencies.io.netty + + + + + io.grpc + grpc-netty + 1.0.1 + + + io.grpc + grpc-protobuf + 1.0.1 + + + io.grpc + grpc-stub + 1.0.1 + + + + + + + kr.motd.maven + os-maven-plugin + 1.4.1.Final + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.5.0 + + com.google.protobuf:protoc:3.0.2:exe:${os.detected.classifier} + grpc-java + io.grpc:protoc-gen-grpc-java:1.0.1:exe:${os.detected.classifier} + + + + + compile + compile-custom + + + + + + maven-compiler-plugin + + 1.7 + 1.7 + UTF-8 + + + + org.apache.maven.plugins + maven-shade-plugin + 2.4.1 + + + package + + shade + + + false + true + true + true + + + ${shade.com.google.source} + ${shade.com.google.target} + + + ${shade.io.grpc.source} + ${shade.io.grpc.target} + + + ${shade.io.netty.source} + ${shade.io.netty.target} + + + + + + + + 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 + 2.4.3 + + ${project.build.sourceEncoding} + + + + + org.apache.maven.plugins + maven-source-plugin + + + + attach-sources + + jar + + + + 2.4 + + + + + diff --git a/skywalking-network/src/main/java/com/a/eye/skywalking/network/GrpcSpanSender.java b/skywalking-network/src/main/java/com/a/eye/skywalking/network/GrpcSpanSender.java new file mode 100644 index 0000000000000000000000000000000000000000..df9bd6028fadd73ea623b7c0af4a91d157dcd45c --- /dev/null +++ b/skywalking-network/src/main/java/com/a/eye/skywalking/network/GrpcSpanSender.java @@ -0,0 +1,18 @@ +package com.a.eye.skywalking.network; + +import com.a.eye.skywalking.network.grpc.SendResult; +import com.a.eye.skywalking.network.grpc.SendingSpans; +import com.a.eye.skywalking.network.grpc.SpanSenderGrpc; +import io.grpc.stub.StreamObserver; + +/** + * Created by xin on 2016/10/25. + */ +public class GrpcSpanSender extends SpanSenderGrpc.SpanSenderImplBase { + + @Override + public StreamObserver send(StreamObserver responseObserver) { + //TODO + return super.send(responseObserver); + } +} diff --git a/skywalking-network/src/main/proto/SpanSender.proto b/skywalking-network/src/main/proto/SpanSender.proto new file mode 100644 index 0000000000000000000000000000000000000000..26ebe9b3acc3371874b6eea307bc705206ce2b38 --- /dev/null +++ b/skywalking-network/src/main/proto/SpanSender.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "com.a.eye.skywalking.network.grpc"; + +import "Spans.proto"; + +service SpanSender { + rpc send (stream SendingSpans) returns (SendResult) { + }; +} + + +message SendResult { + // 0 成功 1 失败 + int32 result = 1; +} + +message SendingSpans { + repeated AckSpan ackSpans = 1; + repeated RequestSpan requestSpans = 2; + repeated InputParametersSpan inputParamSpans = 3; + repeated OutputParametersSpan outputParamSpans = 4; +} + diff --git a/skywalking-network/src/main/proto/Spans.proto b/skywalking-network/src/main/proto/Spans.proto new file mode 100644 index 0000000000000000000000000000000000000000..72f7227e936558f202958911ccbe49f12fffed2e --- /dev/null +++ b/skywalking-network/src/main/proto/Spans.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "com.a.eye.skywalking.network.grpc"; + +message AckSpan { + string traceId = 1; + string parentLevel = 2; + int32 levelId = 3; + int64 cost = 4; + int32 statusCode = 5; + string exceptionStack = 6; + string viewpointId = 7; +} + +message RequestSpan { + string traceId = 1; + string parentLevel = 2; + int32 levelId = 3; + string viewPointId = 4; + int64 startDate = 5; + string spanTypeDesc = 6; + string callType = 7; + uint32 spanType = 8; + string applicationId = 9; + string userId = 10; + string bussinessKey = 11; + string agentId = 12; + string processNo = 13; + string address = 14; +} + +message InputParametersSpan { + string traceId = 1; + string traceLevelId = 2; + map parameters = 3; +} + +message OutputParametersSpan { + string traceId = 1; + string traceLevelId = 2; + string outputParameter = 3; +}