diff --git a/pom.xml b/pom.xml index b46401598f..23a7fbe105 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 1.5 - 3.3.3 + 3.4.0-SNAPSHOT 1.1.1 1.16 1.22 diff --git a/subsys/service/src/main/java/org/commonjava/indy/subsys/service/IndyClientProducer.java b/subsys/service/src/main/java/org/commonjava/indy/subsys/service/IndyClientProducer.java index fb3fe4bf6c..c8b0f67b9f 100644 --- a/subsys/service/src/main/java/org/commonjava/indy/subsys/service/IndyClientProducer.java +++ b/subsys/service/src/main/java/org/commonjava/indy/subsys/service/IndyClientProducer.java @@ -21,6 +21,7 @@ import org.commonjava.indy.client.core.auth.IndyClientAuthenticator; import org.commonjava.indy.client.core.module.IndyStoreQueryClientModule; import org.commonjava.indy.client.core.module.IndyStoresClientModule; +import org.commonjava.indy.client.core.o11y.trace.ClientTracerConfiguration; import org.commonjava.indy.model.core.io.IndyObjectMapper; import org.commonjava.indy.subsys.trace.config.IndyTraceConfiguration; import org.commonjava.indy.subsys.service.config.RepositoryServiceConfig; @@ -69,14 +70,25 @@ public void init() Collection modules = Arrays.asList( new IndyStoresClientModule(), new IndyStoreQueryClientModule() ); + try { + final Indy.Builder builder = Indy.builder() .setLocation( config ) .setObjectMapper( new IndyObjectMapper( Collections.emptySet() ) ) - .setExistedTraceConfig( indyTraceConfig ) .setMdcCopyMappings( Collections.emptyMap() ) .setModules( modules.toArray( new IndyClientModule[0] ) ); + if ( indyTraceConfig != null && indyTraceConfig.isEnabled() ) + { + ClientTracerConfiguration clientTracerConfig = new ClientTracerConfiguration(); + clientTracerConfig.setEnabled( true ); + clientTracerConfig.setConsoleTransport( indyTraceConfig.isConsoleTransport() ); + clientTracerConfig.setGrpcHeaders( indyTraceConfig.getGrpcHeaders() ); + clientTracerConfig.setGrpcUri( indyTraceConfig.getGrpcEndpointUri() ); + clientTracerConfig.setGrpcResources( indyTraceConfig.getResources() ); + builder.setTraceConfiguration( clientTracerConfig ); + } if ( serviceConfig.isAuthEnabled() ) { IndyClientAuthenticator authenticator = @@ -85,13 +97,14 @@ public void init() serviceConfig.getKeycloakClientId(), serviceConfig.getKeycloakClientSecret(), serviceConfig.getRefreshTokenTimeSkew() ); - client = builder.setAuthenticator( authenticator ).build(); + builder.setAuthenticator( authenticator ); } else { - client = builder.setPasswordManager( new MemoryPasswordManager() ).build(); + builder.setPasswordManager( new MemoryPasswordManager() ); } + client = builder.build(); } catch ( IndyClientException e ) {