Smoke tests using Jaeger and Zipkin exporters
ADD
smoke-tests/src/test/groovy/io/opentelemetry/smoketest/JaegerExporterSmokeTest.groovy
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.smoketest
+
+import static java.util.stream.Collectors.toSet
+
+import io.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest
+import java.util.jar.Attributes
+import java.util.jar.JarFile
+import okhttp3.Request
+
+class JaegerExporterSmokeTest extends SmokeTest {
+
+ protected String getTargetImage(int jdk) {
+ "open-telemetry-docker-dev.bintray.io/java/smoke-springboot-jdk$jdk:latest"
+ }
+
+ @Override
+ protected Map<String, String> getExtraEnv() {
+ return [
+ "OTEL_EXPORTER" : "jaeger",
+ "OTEL_EXPORTER_JAEGER_ENDPOINT": "collector:14250"
+ ]
+ }
+
+ def "spring boot smoke test with Zipkin"() {
+ setup:
+ startTarget(11)
+
+ String url = "http://localhost:${target.getMappedPort(8080)}/greeting"
+ def request = new Request.Builder().url(url).get().build()
+
+ def currentAgentVersion = new JarFile(agentPath).getManifest().getMainAttributes().get(Attributes.Name.IMPLEMENTATION_VERSION)
+
+ when:
+ def response = CLIENT.newCall(request).execute()
+ Collection<ExportTraceServiceRequest> traces = waitForTraces()
+
+ then:
+ response.body().string() == "Hi!"
+ countSpansByName(traces, '/greeting') == 1
+ countSpansByName(traces, 'WebController.greeting') == 1
+ countSpansByName(traces, 'WebController.withSpan') == 1
+
+ [currentAgentVersion] as Set == findResourceAttribute(traces, "telemetry.auto.version")
+ .map { it.stringValue }
+ .collect(toSet())
+
+ cleanup:
+ stopTarget()
+
+ }
+
+}

ADD
smoke-tests/src/test/groovy/io/opentelemetry/smoketest/ZipkinExporterSmokeTest.groovy
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.smoketest
+
+import io.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest
+import okhttp3.Request
+
+class ZipkinExporterSmokeTest extends SmokeTest{
+
+ protected String getTargetImage(int jdk) {
+ "open-telemetry-docker-dev.bintray.io/java/smoke-springboot-jdk$jdk:latest"
+ }
+
+ @Override
+ protected Map<String, String> getExtraEnv() {
+ return [
+ "OTEL_EXPORTER": "zipkin",
+ "OTEL_EXPORTER_ZIPKIN_ENDPOINT": "http://collector:9411/api/v2/spans"
+ ]
+ }
+
+ def "spring boot smoke test with Zipkin"() {
+ setup:
+ startTarget(11)
+
+ String url = "http://localhost:${target.getMappedPort(8080)}/greeting"
+ def request = new Request.Builder().url(url).get().build()
+
+// def currentAgentVersion = new JarFile(agentPath).getManifest().getMainAttributes().get(Attributes.Name.IMPLEMENTATION_VERSION)
+
+ when:
+ def response = CLIENT.newCall(request).execute()
+ Collection<ExportTraceServiceRequest> traces = waitForTraces()
+
+ then:
+ response.body().string() == "Hi!"
+ countSpansByName(traces, '/greeting') == 1
+ countSpansByName(traces, 'webcontroller.greeting') == 1
+ countSpansByName(traces, 'webcontroller.withspan') == 1
+
+ //This is currently broken, see https://github.com/open-telemetry/opentelemetry-java/issues/1970
+// [currentAgentVersion] as Set == findResourceAttribute(traces, "telemetry.auto.version")
+// .map { it.stringValue }
+// .collect(toSet())
+
+ cleanup:
+ stopTarget()
+
+ }
+
+}

MODIFY
smoke-tests/src/test/resources/otel.yaml
smoke-tests/src/test/resources/otel.yaml
@@ -9,6 +9,10 @@ receivers:
otlp:
protocols:
grpc:
+ zipkin:
+ jaeger:
+ protocols:
+ grpc:
processors:
batch:
@@ -24,7 +28,7 @@ exporters:
service:
pipelines:
traces:
- receivers: [otlp]
+ receivers: [otlp, zipkin, jaeger]
processors: [batch, queued_retry]
exporters: [logging, otlp]

Smoke tests using Jaeger and Zipkin exporters (#1543)