Skip to content

Commit

Permalink
Fix integration between Rest Client Reactive and OpenTracing
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Jul 19, 2021
1 parent f8f57cd commit 9ebcdeb
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -110,6 +112,20 @@ void setUpDefaultMediaType(BuildProducer<RestClientDefaultConsumesBuildItem> con
}
}

@BuildStep
void registerRestClientListenerForTracing(
Capabilities capabilities,
BuildProducer<NativeImageResourceBuildItem> resource,
BuildProducer<ReflectiveClassBuildItem> 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(
Expand Down

0 comments on commit 9ebcdeb

Please sign in to comment.