File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
entity-service-factory/src/main/java/org/hypertrace/entity/service
src/main/java/org/hypertrace/entity/metric Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1717import org .hypertrace .entity .attribute .translator .EntityAttributeMapping ;
1818import org .hypertrace .entity .data .service .EntityDataServiceImpl ;
1919import org .hypertrace .entity .metric .EntityCounterMetricSender ;
20+ import org .hypertrace .entity .metric .EntityMetricsReporter ;
2021import org .hypertrace .entity .query .service .EntityQueryServiceImpl ;
2122import org .hypertrace .entity .service .change .event .api .EntityChangeEventGenerator ;
2223import org .hypertrace .entity .service .change .event .impl .EntityChangeEventGeneratorFactory ;
@@ -38,6 +39,8 @@ public List<GrpcPlatformService> buildServices(
3839 EntityServiceDataStoreConfig entityServiceDatastoreConfig =
3940 new EntityServiceDataStoreConfig (config );
4041 datastore = DatastoreProvider .getDatastore (entityServiceDatastoreConfig .getDataStoreConfig ());
42+
43+ new EntityMetricsReporter (datastore , grpcServiceContainerEnvironment .getLifecycle ()).monitor ();
4144 grpcServiceContainerEnvironment .getLifecycle ().shutdownComplete ().thenRun (datastore ::close );
4245
4346 EntityAttributeMapping entityAttributeMapping =
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ dependencies {
1717 implementation(" org.hypertrace.core.grpcutils:grpc-client-utils:0.12.6" )
1818 implementation(" org.hypertrace.core.attribute.service:caching-attribute-service-client:0.14.15" )
1919 implementation(" org.hypertrace.core.serviceframework:platform-metrics:0.1.62" )
20+ implementation(" org.hypertrace.core.serviceframework:docstore-metrics:0.1.62" )
2021 implementation(" com.google.inject:guice:5.0.1" )
2122
2223 implementation(project(" :entity-type-service-rx-client" ))
Original file line number Diff line number Diff line change 1+ package org .hypertrace .entity .metric ;
2+
3+ import org .hypertrace .core .documentstore .Datastore ;
4+ import org .hypertrace .core .serviceframework .docstore .metrics .DocStoreMetricsRegistry ;
5+ import org .hypertrace .core .serviceframework .spi .PlatformServiceLifecycle ;
6+
7+ public class EntityMetricsReporter {
8+ private final DocStoreMetricsRegistry metricsRegistry ;
9+
10+ public EntityMetricsReporter (
11+ final Datastore datastore , final PlatformServiceLifecycle lifecycle ) {
12+ metricsRegistry = new DocStoreMetricsRegistry (datastore ).withPlatformLifecycle (lifecycle );
13+ }
14+
15+ public void monitor () {
16+ metricsRegistry .monitor ();
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments