File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
platform-http-service-framework
src/main/java/org/hypertrace/core/serviceframework/http Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ dependencies {
1111 api(" com.google.inject:guice:5.1.0" )
1212 api(project(" :service-framework-spi" ))
1313
14+ implementation(project(" :platform-metrics" ))
1415 implementation(" org.slf4j:slf4j-api:1.7.36" )
1516 implementation(" com.google.inject.extensions:guice-servlet:5.1.0" )
1617 implementation(" com.google.guava:guava:31.1-jre" )
Original file line number Diff line number Diff line change 33import static io .grpc .Deadline .after ;
44import static java .util .concurrent .TimeUnit .SECONDS ;
55
6+ import io .micrometer .core .instrument .binder .grpc .MetricCollectingClientInterceptor ;
67import java .util .List ;
78import java .util .stream .Collectors ;
89import lombok .extern .slf4j .Slf4j ;
910import org .hypertrace .core .grpcutils .client .GrpcChannelRegistry ;
11+ import org .hypertrace .core .grpcutils .client .GrpcRegistryConfig ;
1012import org .hypertrace .core .serviceframework .PlatformService ;
1113import org .hypertrace .core .serviceframework .config .ConfigClient ;
1214import org .hypertrace .core .serviceframework .http .jetty .JettyHttpServerBuilder ;
15+ import org .hypertrace .core .serviceframework .metrics .PlatformMetricsRegistry ;
1316
1417@ Slf4j
1518public abstract class StandAloneHttpPlatformServiceContainer extends PlatformService {
1619 private HttpContainer container ;
17- private final GrpcChannelRegistry grpcChannelRegistry = new GrpcChannelRegistry () ;
20+ private final GrpcChannelRegistry grpcChannelRegistry ;
1821
1922 public StandAloneHttpPlatformServiceContainer (ConfigClient config ) {
2023 super (config );
24+ grpcChannelRegistry =
25+ new GrpcChannelRegistry (
26+ GrpcRegistryConfig .builder ()
27+ .defaultInterceptor (
28+ new MetricCollectingClientInterceptor (
29+ PlatformMetricsRegistry .getMeterRegistry ()))
30+ .build ());
2131 }
2232
2333 protected abstract List <HttpHandlerFactory > getHandlerFactories ();
You can’t perform that action at this time.
0 commit comments