Skip to content

Commit

Permalink
Fix OpenTelemetry substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand authored and holly-cummins committed Apr 27, 2022
1 parent c76e807 commit 5811091
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@
import io.opentelemetry.exporter.internal.grpc.ManagedChannelUtil;

/**
* Replace the {@link ManagedChannelUtil#setTrustedCertificatesPem(ManagedChannelBuilder, byte[])} method in native
* Replace the {@link ManagedChannelUtil#setClientKeysAndTrustedCertificatesPem(ManagedChannelBuilder, byte[], byte[], byte[])}
* method in native
* because the method implementation tries to look for grpc-netty-shaded dependencies, which we don't support.
*
* Check:
* https://github.com/open-telemetry/opentelemetry-java/blob/v1.9.1/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/grpc/ManagedChannelUtil.java#L56-L89
* https://github.com/open-telemetry/opentelemetry-java/blob/v1.13.0/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/grpc/ManagedChannelUtil.java#L47-L91
*/
final class JaegerSubstitutions {
@TargetClass(ManagedChannelUtil.class)
static final class Target_ManagedChannelUtil {
@Substitute
public static void setTrustedCertificatesPem(
ManagedChannelBuilder<?> managedChannelBuilder, byte[] trustedCertificatesPem)
public static void setClientKeysAndTrustedCertificatesPem(
ManagedChannelBuilder<?> managedChannelBuilder, byte[] privateKeyPem, byte[] certificatePem,
byte[] trustedCertificatesPem)
throws SSLException {
requireNonNull(managedChannelBuilder, "managedChannelBuilder");
requireNonNull(trustedCertificatesPem, "trustedCertificatesPem");
Expand Down
19 changes: 19 additions & 0 deletions integration-tests/resteasy-reactive-kotlin/standard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-kotlin</artifactId>
</dependency>
<!-- Added only to make sure that the Jaeger exporter compiles in native -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry-exporter-jaeger</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down Expand Up @@ -164,6 +169,20 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry-exporter-jaeger-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>


</dependencies>

Expand Down

0 comments on commit 5811091

Please sign in to comment.