Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Nov 2, 2023
1 parent 9475716 commit e958915
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,14 @@ SpanDataAssert assertClientSpan(
.doesNotContainKey(SemanticAttributes.NETWORK_TYPE);
}

// only protocol names different from "http" are emitted
AttributeKey<String> netProtocolKey =
getAttributeKey(SemanticAttributes.NET_PROTOCOL_NAME);
assertThat(attrs).doesNotContainKey(netProtocolKey);
if (SemconvStability.emitStableHttpSemconv()) {
// only protocol names different from "http" are emitted
assertThat(attrs).doesNotContainKey(netProtocolKey);
} else if (attrs.get(netProtocolKey) != null) {
assertThat(attrs).containsEntry(netProtocolKey, "http");
}
AttributeKey<String> netProtocolVersionKey =
getAttributeKey(SemanticAttributes.NET_PROTOCOL_VERSION);
if (httpClientAttributes.contains(netProtocolVersionKey)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,14 @@ protected SpanDataAssert assertServerSpan(
assertThat(attrs).containsEntry(HttpAttributes.ERROR_TYPE, String.valueOf(statusCode));
}

// only protocol names different from "http" are emitted
AttributeKey<String> netProtocolKey =
getAttributeKey(SemanticAttributes.NET_PROTOCOL_NAME);
assertThat(attrs).doesNotContainKey(netProtocolKey);
if (SemconvStability.emitStableHttpSemconv()) {
// only protocol names different from "http" are emitted
assertThat(attrs).doesNotContainKey(netProtocolKey);
} else if (attrs.get(netProtocolKey) != null) {
assertThat(attrs).containsEntry(netProtocolKey, "http");
}
AttributeKey<String> netProtocolVersionKey =
getAttributeKey(SemanticAttributes.NET_PROTOCOL_VERSION);
if (attrs.get(netProtocolVersionKey) != null) {
Expand Down

0 comments on commit e958915

Please sign in to comment.