Skip to content

Commit

Permalink
Update TCK to test for all required REST span properties per semantic…
Browse files Browse the repository at this point in the history
… conventions 1.19 (#95)

* Specific values of span name is not checked, rather absence of high-cardinality parts of requests
* `net.host.name` and `net.host.port` are required for server Rest spans
* `http.route` is required for server Rest spans
* `net.peer.name` and `net.peer.host` are required for client Rest spans
* error status of span is required for certain 4xx and 5xx requests

Fixes #86, #44

Signed-off-by: Patrik Dudits <patrik.dudits@payara.fish>
  • Loading branch information
pdudits committed Jun 27, 2023
1 parent f9c2cae commit 22956d8
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 185 deletions.
Expand Up @@ -58,5 +58,6 @@ public static class TracerBean {
public Tracer getTracer() {
return tracer;
}

}
}
Expand Up @@ -31,6 +31,7 @@
import org.awaitility.Awaitility;
import org.testng.Assert;

import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.sdk.common.CompletableResultCode;
import io.opentelemetry.sdk.trace.data.SpanData;
import io.opentelemetry.sdk.trace.export.SpanExporter;
Expand Down Expand Up @@ -82,4 +83,9 @@ public CompletableResultCode shutdown() {
isStopped = true;
return CompletableResultCode.ofSuccess();
}

public SpanData getFirst(SpanKind spanKind) {
return finishedSpanItems.stream().filter(span -> span.getKind() == spanKind).findFirst()
.orElseThrow(() -> new IllegalStateException("No span found with kind " + spanKind));
}
}

0 comments on commit 22956d8

Please sign in to comment.