Assert on instrumentation version
To catch issues like
MODIFY
instrumentation/quartz-2.0/testing/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/AbstractQuartzTest.java
instrumentation/quartz-2.0/testing/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/AbstractQuartzTest.java
@@ -117,7 +117,7 @@ public abstract class AbstractQuartzTest {
public static class SuccessfulJob implements Job {
@Override
public void execute(JobExecutionContext context) {
- GlobalOpenTelemetry.getTracer("jobtracer").spanBuilder("child").startSpan().end();
+ GlobalOpenTelemetry.getTracer("test").spanBuilder("child").startSpan().end();
// ensure that JobExecutionContext is serializable
try {
new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(context);

MODIFY
instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts
instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts
plugins {
- id("otel.java-conventions")
- id("otel.publish-conventions")
+ id("otel.library-instrumentation")
}
// Name the Spring Boot modules in accordance with https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.developing-auto-configuration.custom-starter

MODIFY
testing-common/src/main/java/io/opentelemetry/instrumentation/testing/util/TelemetryDataUtil.java
testing-common/src/main/java/io/opentelemetry/instrumentation/testing/util/TelemetryDataUtil.java
package io.opentelemetry.instrumentation.testing.util;
import static java.util.stream.Collectors.toList;
+import static org.assertj.core.api.Assertions.assertThat;
import io.opentelemetry.api.trace.SpanId;
import io.opentelemetry.api.trace.SpanKind;
@@ -73,6 +74,14 @@ public final class TelemetryDataUtil {
+ " total trace(s): "
+ allTraces);
}
+ // TODO (trask) is there a better location for this assertion?
+ for (List<SpanData> trace : completeTraces) {
+ for (SpanData span : trace) {
+ if (!span.getInstrumentationScopeInfo().getName().equals("test")) {
+ assertThat(span.getInstrumentationScopeInfo().getVersion()).isNotNull();
+ }
+ }
+ }
return completeTraces;
}

Assert on instrumentation version (#6773)

To catch issues like #6770