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 c6d7796 commit 50ed44d
Show file tree
Hide file tree
Showing 2 changed files with 35 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
19 changes: 19 additions & 0 deletions integration-tests/micrometer-prometheus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
</dependency>

<!-- Verify that the client works with OpenTracing -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-opentracing</artifactId>
</dependency>

<!-- Verify extensions co-exist -->
<dependency>
<groupId>io.quarkus</groupId>
Expand Down Expand Up @@ -134,6 +140,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-opentracing-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-kubernetes-deployment</artifactId>
Expand Down

0 comments on commit 50ed44d

Please sign in to comment.