diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java index 626a5cc8a028f..b430fb8a37541 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java @@ -58,6 +58,8 @@ import io.quarkus.deployment.builditem.ConfigurationTypeBuildItem; import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; import io.quarkus.deployment.util.AsmUtil; import io.quarkus.gizmo.ClassCreator; import io.quarkus.gizmo.MethodCreator; @@ -110,6 +112,20 @@ void setUpDefaultMediaType(BuildProducer con } } + @BuildStep + void registerRestClientListenerForTracing( + Capabilities capabilities, + BuildProducer resource, + BuildProducer reflectiveClass) { + if (capabilities.isPresent(Capability.SMALLRYE_OPENTRACING)) { + resource.produce(new NativeImageResourceBuildItem( + "META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientListener")); + reflectiveClass + .produce(new ReflectiveClassBuildItem(true, false, false, + "io.smallrye.opentracing.SmallRyeRestClientListener")); + } + } + @BuildStep @Record(ExecutionTime.STATIC_INIT) void setupAdditionalBeans(