Skip to content

Commit

Permalink
Merge pull request #18807 from geoand/#18806
Browse files Browse the repository at this point in the history
Fix integration between Rest Client Reactive and OpenTracing
  • Loading branch information
geoand authored Jul 19, 2021
2 parents 7ba8bc7 + 9ebcdeb commit c776e22
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 c776e22

Please sign in to comment.