diff --git a/micrometer-core/src/main/java/io/micrometer/core/instrument/push/PushMeterRegistry.java b/micrometer-core/src/main/java/io/micrometer/core/instrument/push/PushMeterRegistry.java index 3367689931..843b8e0782 100644 --- a/micrometer-core/src/main/java/io/micrometer/core/instrument/push/PushMeterRegistry.java +++ b/micrometer-core/src/main/java/io/micrometer/core/instrument/push/PushMeterRegistry.java @@ -107,8 +107,7 @@ public void start(ThreadFactory threadFactory) { stop(); if (config.enabled()) { - logger.info("publishing metrics for " + getClass().getSimpleName() + " every " - + TimeUtils.format(config.step())); + logger.info(startMessage()); scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(threadFactory); long stepMillis = config.step().toMillis(); @@ -118,6 +117,17 @@ public void start(ThreadFactory threadFactory) { } } + /** + * Message that will be logged when the registry is {@link #start(ThreadFactory) + * started}. This can be overridden to customize the message with info specific to the + * registry implementation that may be helpful in troubleshooting. By default, the + * registry class name and step interval are included. + * @return message to log on registry start + */ + protected String startMessage() { + return "publishing metrics for " + getClass().getSimpleName() + " every " + TimeUtils.format(config.step()); + } + public void stop() { if (scheduledExecutorService != null) { scheduledExecutorService.shutdown();