1. add skywalking-opentracing-kit module 2.add a network client
This commit is contained in:
parent
d529005443
commit
3e21eaa681
2
pom.xml
2
pom.xml
|
|
@ -13,6 +13,8 @@
|
|||
<!--<module>skywalking-webui</module>-->
|
||||
<!--<module>skywalking-sniffer</module>-->
|
||||
<module>skywalking-storage-center</module>
|
||||
<module>skywalking-opentracing-kit</module>
|
||||
|
||||
<module>samples/skywalking-auth</module>
|
||||
<module>samples/skywalking-example</module>
|
||||
</modules>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,21 @@
|
|||
package com.a.eye.skywalking.network;
|
||||
|
||||
import com.a.eye.skywalking.network.grpc.SpanStorageServiceGrpc;
|
||||
import com.a.eye.skywalking.network.grpc.TraceSearchServiceGrpc;
|
||||
import com.a.eye.skywalking.network.grpc.client.SpanStorageClient;
|
||||
import com.a.eye.skywalking.network.grpc.client.TraceSearchClient;
|
||||
import io.grpc.ManagedChannel;
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
|
||||
import static com.a.eye.skywalking.network.grpc.SpanStorageServiceGrpc.newStub;
|
||||
|
||||
public class Client {
|
||||
private ManagedChannel channel;
|
||||
private SpanStorageServiceGrpc.SpanStorageServiceStub spanStorageStub;
|
||||
private TraceSearchServiceGrpc.TraceSearchServiceStub traceSearchServiceStub;
|
||||
|
||||
public Client(String ip, int address) {
|
||||
channel = ManagedChannelBuilder.forAddress(ip, address).usePlaintext(true).build();
|
||||
spanStorageStub = newStub(channel);
|
||||
spanStorageStub = SpanStorageServiceGrpc.newStub(channel);
|
||||
traceSearchServiceStub = TraceSearchServiceGrpc.newStub(channel);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -22,4 +24,7 @@ public class Client {
|
|||
}
|
||||
|
||||
|
||||
public TraceSearchClient newTraceSearchClient(){
|
||||
return new TraceSearchClient(traceSearchServiceStub);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.a.eye.skywalking.network.grpc.client;
|
||||
|
||||
import com.a.eye.skywalking.network.grpc.TraceSearchServiceGrpc;
|
||||
|
||||
/**
|
||||
* Created by wusheng on 2016/11/26.
|
||||
*/
|
||||
public class TraceSearchClient {
|
||||
|
||||
private final TraceSearchServiceGrpc.TraceSearchServiceStub traceSearchServiceStub;
|
||||
|
||||
public TraceSearchClient(TraceSearchServiceGrpc.TraceSearchServiceStub traceSearchServiceStub) {
|
||||
this.traceSearchServiceStub = traceSearchServiceStub;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<parent>
|
||||
<artifactId>skywalking</artifactId>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<version>2.0-2016</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>skywalking-opentracing-kit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
</project>
|
||||
Loading…
Reference in New Issue