Skip to content

Commit

Permalink
deps: work around unnecessary dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Aug 6, 2024
1 parent 59d6caf commit f94aa2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
</dependency>

<!-- Add OpenTelemetry implementation and exporters for use in integration tests -->
<!-- TODO: Remove this alpha dependency when the bug in OpenTelemetry has been fixed that makes SdkTracer implement ExtendedTracer -->
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api-incubator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import com.google.common.collect.Iterables;
import com.google.devtools.cloudtrace.v1.ListTracesRequest;
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.api.incubator.trace.ExtendedTracer;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.sdk.OpenTelemetrySdk;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.trace.SdkTracerProvider;
Expand Down Expand Up @@ -79,7 +81,7 @@ public class ITOpenTelemetryTest extends ITAbstractJdbcTest {
private Database database;

@BeforeClass
public static void setupOpenTelemetry() throws IOException {
public static void setupOpenTelemetry() {
assumeFalse("This test requires credentials", EmulatorSpannerHelper.isUsingEmulator());

SpannerOptions options = env.getTestHelper().getOptions();
Expand All @@ -103,6 +105,9 @@ public static void setupOpenTelemetry() throws IOException {
.addSpanProcessor(BatchSpanProcessor.builder(traceExporter).build())
.build())
.build();
// TODO: Remove when the bug in OpenTelemetry that has SdkTracer implement ExtendedTracer,
// which is only available in the incubator project.
ExtendedTracer ignore = (ExtendedTracer) openTelemetry.getTracer("foo");
}

@AfterClass
Expand Down Expand Up @@ -245,8 +250,6 @@ private void assertTrace(String sql) throws IOException, InterruptedException {
Thread.sleep(5000L);
boolean foundTrace = false;
for (int attempts = 0; attempts < 20; attempts++) {
// Ignore deprecation for now, as there is no alternative offered (yet?).
//noinspection deprecation
ListTracesPagedResponse response =
client.listTraces(
ListTracesRequest.newBuilder()
Expand Down

0 comments on commit f94aa2e

Please sign in to comment.