Skip to content

Commit

Permalink
Fix use of OpenTelemetry OTLP exporter in native mode
Browse files Browse the repository at this point in the history
Essentially the fact that ClientTracingFilter was using a static
field for TextMapPropagator was causing GraalVM to initialize
the entire telemetry infrastructure at build time

Fixes: quarkusio#19877
  • Loading branch information
geoand committed Sep 3, 2021
1 parent e4073c9 commit d142b2f
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@

@Priority(Priorities.HEADER_DECORATOR)
public class ClientTracingFilter implements ClientRequestFilter, ClientResponseFilter {
private static final TextMapPropagator TEXT_MAP_PROPAGATOR = GlobalOpenTelemetry.getPropagators().getTextMapPropagator();
private final TextMapPropagator TEXT_MAP_PROPAGATOR = GlobalOpenTelemetry.getPropagators().getTextMapPropagator();

private static final String SCOPE_KEY = ClientTracingFilter.class.getName() + ".scope";
private static final String SPAN_KEY = ClientTracingFilter.class.getName() + ".span";
18 changes: 18 additions & 0 deletions integration-tests/resteasy-reactive-rest-client/pom.xml
Original file line number Diff line number Diff line change
@@ -31,6 +31,11 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry</artifactId>
</dependency>
<!-- Support for OpenTelemetry by exporting to otlp -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry-exporter-otlp</artifactId>
</dependency>

<!-- Needed for InMemorySpanExporter to verify captured traces -->
<dependency>
@@ -99,6 +104,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry-exporter-otlp-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>

0 comments on commit d142b2f

Please sign in to comment.