Skip to content

Commit 4d1d120

Browse files
committed
fix
1 parent 4dd6db1 commit 4d1d120

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/semconv/http/HttpServerAttributesExtractorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public String getNetworkProtocolName(
128128
@Override
129129
public String getNetworkProtocolVersion(
130130
Map<String, String> request, @Nullable Map<String, String> response) {
131-
return requireNonNull(response).get("networkProtocolVersion");
131+
return requireNonNull(request).get("networkProtocolVersion");
132132
}
133133

134134
@Nullable

instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/semconv/network/NetworkAttributesExtractorInetSocketAddressTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void fullAddress() {
6565
}
6666

6767
@Test
68-
void noAttributes() {
68+
void minimalAttributes() {
6969
AttributesExtractor<InetSocketAddress, InetSocketAddress> extractor =
7070
NetworkAttributesExtractor.create(new TestNetworkAttributesGetter());
7171

@@ -76,6 +76,10 @@ void noAttributes() {
7676

7777
AttributesBuilder endAttributes = Attributes.builder();
7878
extractor.onEnd(endAttributes, Context.root(), request, null, null);
79-
assertThat(endAttributes.build()).isEmpty();
79+
assertThat(endAttributes.build())
80+
.containsOnly(
81+
entry(NETWORK_TYPE, "ipv4"),
82+
entry(NETWORK_LOCAL_ADDRESS, "1.2.3.4"),
83+
entry(NETWORK_LOCAL_PORT, 8080L));
8084
}
8185
}

0 commit comments

Comments
 (0)