File tree Expand file tree Collapse file tree
agent-providers/span/src/main/java/com/expedia/www/haystack/agent/span Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .expedia .www .haystack .agent .span .service ;
2+
3+ import io .grpc .health .v1 .HealthCheckRequest ;
4+ import io .grpc .health .v1 .HealthCheckResponse ;
5+ import io .grpc .health .v1 .HealthGrpc ;
6+ import io .grpc .stub .StreamObserver ;
7+
8+ public class SpanGrpcHealthService extends HealthGrpc .HealthImplBase {
9+
10+ @ Override
11+ public void check (HealthCheckRequest request , StreamObserver <HealthCheckResponse > responseObserver ) {
12+ responseObserver .onNext (HealthCheckResponse .newBuilder ().setStatus (HealthCheckResponse .ServingStatus .SERVING ).build ());
13+ responseObserver .onCompleted ();
14+ }
15+ }
Original file line number Diff line number Diff line change 2020import com .expedia .www .haystack .agent .core .BaseAgent ;
2121import com .expedia .www .haystack .agent .span .enricher .Enricher ;
2222import com .expedia .www .haystack .agent .span .service .SpanAgentGrpcService ;
23+ import com .expedia .www .haystack .agent .span .service .SpanGrpcHealthService ;
2324import com .typesafe .config .Config ;
2425import io .grpc .Server ;
2526import io .grpc .netty .NettyServerBuilder ;
@@ -55,6 +56,7 @@ public void initialize(final Config config) throws IOException {
5556 .permitKeepAliveWithoutCalls (true )
5657 .permitKeepAliveTime (KEEP_ALIVE_TIME_IN_SECONDS , TimeUnit .SECONDS )
5758 .addService (new SpanAgentGrpcService (dispatchers , enrichers ))
59+ .addService (new SpanGrpcHealthService ())
5860 .build ()
5961 .start ();
6062
Original file line number Diff line number Diff line change 2222 <groupId >io.grpc</groupId >
2323 <artifactId >grpc-all</artifactId >
2424 </dependency >
25+ <dependency >
26+ <groupId >io.grpc</groupId >
27+ <artifactId >grpc-services</artifactId >
28+ </dependency >
2529 </dependencies >
2630
2731 <build >
Original file line number Diff line number Diff line change 124124 <version >${grpc.version} </version >
125125 </dependency >
126126
127+ <dependency >
128+ <groupId >io.grpc</groupId >
129+ <artifactId >grpc-services</artifactId >
130+ <version >${grpc.version} </version >
131+ </dependency >
132+
127133 <dependency >
128134 <groupId >com.google.protobuf</groupId >
129135 <artifactId >protobuf-java-util</artifactId >
You can’t perform that action at this time.
0 commit comments