diff --git a/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/CollectorGrpcConfiguration.java b/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/CollectorGrpcConfiguration.java index 2af98bab4b73..f28a290968fa 100644 --- a/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/CollectorGrpcConfiguration.java +++ b/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/CollectorGrpcConfiguration.java @@ -35,9 +35,11 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean; @Configuration +@EnableScheduling @Import({ GrpcComponentConfiguration.class, diff --git a/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/config/GrpcKeepAliveScheduler.java b/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/config/GrpcKeepAliveScheduler.java index 81278702dce9..bc6aa472b896 100644 --- a/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/config/GrpcKeepAliveScheduler.java +++ b/collector/src/main/java/com/navercorp/pinpoint/collector/grpc/config/GrpcKeepAliveScheduler.java @@ -1,6 +1,9 @@ package com.navercorp.pinpoint.collector.grpc.config; import com.navercorp.pinpoint.collector.receiver.grpc.service.KeepAliveService; +import com.navercorp.pinpoint.common.profiler.logging.ThrottledLogger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -8,6 +11,9 @@ @Component public class GrpcKeepAliveScheduler { + private final Logger logger = LogManager.getLogger(this.getClass()); + private final ThrottledLogger throttledLogger = ThrottledLogger.getLogger(logger, 12); + private final KeepAliveService keepAliveService; public GrpcKeepAliveScheduler(KeepAliveService keepAliveService) { @@ -16,6 +22,9 @@ public GrpcKeepAliveScheduler(KeepAliveService keepAliveService) { @Scheduled(fixedRate = 300_000, scheduler = "grpcLifecycleScheduler") public void keepAliveServiceUpdate() { + if (throttledLogger.isInfoEnabled()) { + throttledLogger.info("keepAliveServiceUpdate started"); + } this.keepAliveService.updateState(); } }