Skip to content

Commit

Permalink
Fix native mode and update parent
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobat committed Oct 24, 2023
1 parent 7374302 commit 07a660e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 6 deletions.
10 changes: 6 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.quarkiverse</groupId>
<artifactId>quarkiverse-parent</artifactId>
<version>12</version>
<version>15</version>
<relativePath /> <!-- always from repository -->
</parent>

Expand Down Expand Up @@ -34,12 +34,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<quarkus.version>3.5.1</quarkus.version>
<quarkus.version>3.5.0</quarkus.version>
<opentelemetry.version>1.30.1</opentelemetry.version>
<opentelemetry-alpha.version>1.30.0-alpha</opentelemetry-alpha.version>

<gcp-opentelemetry.version>0.25.2</gcp-opentelemetry.version>
<gax-grpc.version>2.25.0</gax-grpc.version>
<!-- 2.24.0 and 2.25.x fail with graalvm. Otel is behind as well but it seems to work ok-->
<gcp-opentelemetry.version>0.23.0</gcp-opentelemetry.version>
<!-- 2.24.0 and 2.25.0 fail with graalvm -->
<gax-grpc.version>2.23.0</gax-grpc.version>

<assertj-core.version>3.24.2</assertj-core.version>
<junit-jupiter.version>1.18.0</junit-jupiter.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkiverse.opentelemetry.exporter.common.runtime;

/**
* The only point in having this class is to allow {@link TracerProviderCustomizer}
* to easily ignore the configured {@link LateBoundSpanProcessor}.
*/
public final class RemovableLateBoundSpanProcessor extends LateBoundSpanProcessor {

public static final RemovableLateBoundSpanProcessor INSTANCE = new RemovableLateBoundSpanProcessor();

private RemovableLateBoundSpanProcessor() {
super(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
quarkus.application.name=opentelemetry-exporter-gcp-integration-test
quarkus.application.version=999-SNAPSHOT

quarkus.opentelemetry.tracer.exporter.otlp.enabled=false

simple/mp-rest/url=${test.url}

quarkus.generate-code.grpc.scan-for-imports=all
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.grpc.MethodDescriptor;
import io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLogLevel;
import io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLogger;
import io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory;

/**
* Cut out unsupported and optional features that are only present in grpc-alts.
Expand Down Expand Up @@ -157,6 +158,16 @@ public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT
@TargetClass(className = "io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory")
final class Targetio_grpc_netty_shaded_io_netty_util_internal_logging_InternalLoggerFactory {

@Substitute
public static InternalLoggerFactory newDefaultFactory(String name) {
return new InternalLoggerFactory() {
@Override
protected InternalLogger newInstance(String s) {
return getInstance(s);
}
};
}

@Substitute
static InternalLogger getInstance(Class<?> clazz) {
return new InternalLogger() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.jboss.jandex.ParameterizedType;
import org.jboss.jandex.Type;

import io.opentelemetry.exporter.internal.grpc.GrpcSenderProvider;
import io.opentelemetry.sdk.trace.SpanProcessor;
import io.opentelemetry.sdk.trace.export.SpanExporter;
import io.quarkiverse.opentelemetry.exporter.common.runtime.LateBoundSpanProcessor;
Expand All @@ -22,6 +23,8 @@
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.LaunchModeBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.opentelemetry.deployment.exporter.otlp.ExternalOtelExporterBuildItem;

@BuildSteps(onlyIf = JaegerExporterProcessor.JaegerExporterEnabled.class)
Expand All @@ -35,6 +38,13 @@ public boolean getAsBoolean() {
}
}

@BuildStep
void retainBeans(BuildProducer<ServiceProviderBuildItem> services) {

services.produce(new ServiceProviderBuildItem(GrpcSenderProvider.class.getName(),
"io.opentelemetry.exporter.sender.okhttp.internal.OkHttpGrpcSenderProvider"));
}

@BuildStep
void registerExternalExporter(BuildProducer<ExternalOtelExporterBuildItem> buildProducer) {
buildProducer.produce(new ExternalOtelExporterBuildItem("jaeger"));
Expand Down
17 changes: 17 additions & 0 deletions quarkus-opentelemetry-exporter-jaeger/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@
</exclusions>
</dependency>

<!-- <dependency>-->
<!-- <groupId>io.opentelemetry</groupId>-->
<!-- <artifactId>opentelemetry-exporter-sender-okhttp</artifactId>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>animal-sniffer-annotations</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>org.checkerframework</groupId>-->
<!-- <artifactId>checker-qual</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->



<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
Expand Down

0 comments on commit 07a660e

Please sign in to comment.