diff --git a/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaBuilder.java b/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaBuilder.java index 2c050386f3..05d6f0175b 100644 --- a/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaBuilder.java +++ b/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaBuilder.java @@ -17,6 +17,9 @@ import java.net.UnknownHostException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.linecorp.armeria.client.ClientBuilder; import com.linecorp.armeria.client.ClientRequestContext; import com.linecorp.armeria.client.encoding.DecodingClient; @@ -39,6 +42,8 @@ */ @Deprecated public class LegacyCentralDogmaBuilder extends AbstractArmeriaCentralDogmaBuilder { + private static final Logger logger = LoggerFactory.getLogger(LegacyCentralDogmaBuilder.class); + /** * Returns a newly-created {@link CentralDogma} instance. * @@ -68,7 +73,11 @@ public CentralDogma build() throws UnknownHostException { final EventLoopGroup executor = clientFactory().eventLoopGroup(); final int maxRetriesOnReplicationLag = maxNumRetriesOnReplicationLag(); + final MeterRegistry meterRegistry = meterRegistry().orElse(clientFactory().meterRegistry()); + if (meterRegistry().isPresent() && meterRegistry().get() != clientFactory().meterRegistry()) { + logger.info("The specified meterRegistry differs from the meterRegistry from clientFactory."); + } final CentralDogma dogma = new LegacyCentralDogma(executor, builder.build(AsyncIface.class), meterRegistry); diff --git a/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogmaBuilder.java b/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogmaBuilder.java index 863d2ee086..af5a7e2105 100644 --- a/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogmaBuilder.java +++ b/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogmaBuilder.java @@ -17,6 +17,9 @@ import java.net.UnknownHostException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.linecorp.armeria.client.ClientBuilder; import com.linecorp.armeria.client.ClientRequestContext; import com.linecorp.armeria.client.WebClient; @@ -34,6 +37,8 @@ */ public final class ArmeriaCentralDogmaBuilder extends AbstractArmeriaCentralDogmaBuilder { + private static final Logger logger = LoggerFactory.getLogger(ArmeriaCentralDogmaBuilder.class); + /** * Returns a newly-created {@link CentralDogma} instance. * @@ -46,7 +51,12 @@ public CentralDogma build() throws UnknownHostException { newClientBuilder(scheme, endpointGroup, cb -> cb.decorator(DecodingClient.newDecorator()), "/"); final EventLoopGroup executor = clientFactory().eventLoopGroup(); final int maxRetriesOnReplicationLag = maxNumRetriesOnReplicationLag(); + final MeterRegistry meterRegistry = meterRegistry().orElse(clientFactory().meterRegistry()); + if (meterRegistry().isPresent() && meterRegistry().get() != clientFactory().meterRegistry()) { + logger.info("The specified meterRegistry differs from the meterRegistry from clientFactory."); + } + final CentralDogma dogma = new ArmeriaCentralDogma(executor, builder.build(WebClient.class), accessToken(), meterRegistry);