Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,19 @@ protected SpanDataAssert assertClientSpan(
.hasKind(SpanKind.CLIENT)
.hasAttributesSatisfying(
attrs -> {
// Check for peer.service when running with javaagent instrumentation
String distroName =
span.actual()
.getResource()
.getAttribute(TelemetryIncubatingAttributes.TELEMETRY_DISTRO_NAME);
if ("opentelemetry-java-instrumentation".equals(distroName)) {
String expectedPeerService = options.getExpectedPeerServiceName().apply(uri);
if (expectedPeerService != null) {
assertThat(attrs)
.containsEntry(PeerIncubatingAttributes.PEER_SERVICE, expectedPeerService);
}
}

// we're opting out of these attributes in the new semconv
assertThat(attrs)
.doesNotContainKey(NetworkAttributes.NETWORK_TRANSPORT)
Expand Down Expand Up @@ -1153,21 +1166,6 @@ protected SpanDataAssert assertClientSpan(
} else {
assertThat(attrs).doesNotContainKey(HttpAttributes.HTTP_REQUEST_RESEND_COUNT);
}
})
.satisfies(
spanData -> {
// Check for peer.service when running with javaagent instrumentation
String distroName =
spanData
.getResource()
.getAttribute(TelemetryIncubatingAttributes.TELEMETRY_DISTRO_NAME);
if ("opentelemetry-java-instrumentation".equals(distroName)) {
String expectedPeerService = options.getExpectedPeerServiceName().apply(uri);
if (expectedPeerService != null) {
assertThat(spanData.getAttributes())
.containsEntry(PeerIncubatingAttributes.PEER_SERVICE, expectedPeerService);
}
}
});
}

Expand Down
Loading