Skip to content

Commit a8daa71

Browse files
committed
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-instrumentation into add-baggage-test-for-abstract-http-server-test
2 parents efa4dcd + d7337c1 commit a8daa71

File tree

37 files changed

+570
-343
lines changed

37 files changed

+570
-343
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash -e
2+
3+
# shellcheck disable=SC2044
4+
for file in $(find instrumentation instrumentation-api -name '*Test.java'); do
5+
echo "Processing $file"
6+
7+
# stable semconv
8+
9+
negative_lookbehind='(?<!import static io.opentelemetry.semconv.)'
10+
11+
for class in "ClientAttributes" "ErrorAttributes" "ExceptionAttributes" "HttpAttributes" "JvmAttributes" "NetworkAttributes" "OtelAttributes" "ServerAttributes" "ServiceAttributes" "TelemetryAttributes" "UrlAttributes" "UserAgentAttributes"; do
12+
for attr in $(perl -ne "print \"\$1\n\" if /$negative_lookbehind$class\.([A-Z][A-Z][A-Z_]*)/" "$file" | sort -u); do
13+
perl -i -pe "s/$negative_lookbehind$class\.$attr/$attr/" "$file"
14+
sed -i "0,/^import/{s/^import/import static io.opentelemetry.semconv.$class.$attr;\nimport/}" "$file"
15+
done
16+
done
17+
18+
# incubating semconv
19+
20+
negative_lookbehind='(?<!import static io.opentelemetry.semconv.incubating.)'
21+
22+
for class in "AwsIncubatingAttributes" "DbIncubatingAttributes" "HttpIncubatingAttributes" "MessagingIncubatingAttributes"; do
23+
for attr in $(perl -ne "print \"\$1\n\" if /$negative_lookbehind$class\.([A-Z][A-Z][A-Z_]*)/" "$file" | sort -u); do
24+
perl -i -pe "s/$negative_lookbehind$class\.$attr/$attr/" "$file"
25+
sed -i "0,/^import/{s/^import/import static io.opentelemetry.semconv.incubating.$class.$attr;\nimport/}" "$file"
26+
done
27+
done
28+
done
29+
30+
./gradlew spotlessApply

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ val dependencyVersions = hashMapOf<String, String>()
88
rootProject.extra["versions"] = dependencyVersions
99

1010
// this line is managed by .github/scripts/update-sdk-version.sh
11-
val otelSdkVersion = "1.45.0"
11+
val otelSdkVersion = "1.46.0"
1212
val otelContribVersion = "1.42.0-alpha"
1313
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
1414

examples/distro/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subprojects {
2727
ext {
2828
versions = [
2929
// this line is managed by .github/scripts/update-sdk-version.sh
30-
opentelemetrySdk : "1.45.0",
30+
opentelemetrySdk : "1.46.0",
3131

3232
// these lines are managed by .github/scripts/update-version.sh
3333
opentelemetryJavaagent : "2.12.0-SNAPSHOT",

examples/extension/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ version '1.0'
2323
ext {
2424
versions = [
2525
// this line is managed by .github/scripts/update-sdk-version.sh
26-
opentelemetrySdk : "1.45.0",
26+
opentelemetrySdk : "1.46.0",
2727

2828
// these lines are managed by .github/scripts/update-version.sh
2929
opentelemetryJavaagent : "2.12.0-SNAPSHOT",

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
99
import static org.assertj.core.api.Assertions.entry;
1010

11-
import io.opentelemetry.api.common.AttributeKey;
1211
import io.opentelemetry.api.common.Attributes;
1312
import io.opentelemetry.api.common.AttributesBuilder;
1413
import io.opentelemetry.context.Context;
@@ -90,9 +89,9 @@ void shouldExtractAllAvailableAttributes() {
9089
entry(DbIncubatingAttributes.DB_CONNECTION_STRING, "mydb:///potatoes"),
9190
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM potato"),
9291
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
93-
entry(AttributeKey.stringKey("db.namespace"), "potatoes"),
94-
entry(AttributeKey.stringKey("db.query.text"), "SELECT * FROM potato"),
95-
entry(AttributeKey.stringKey("db.operation.name"), "SELECT"));
92+
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
93+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
94+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
9695
} else if (SemconvStability.emitOldDatabaseSemconv()) {
9796
assertThat(startAttributes.build())
9897
.containsOnly(
@@ -106,9 +105,9 @@ void shouldExtractAllAvailableAttributes() {
106105
assertThat(startAttributes.build())
107106
.containsOnly(
108107
entry(DbIncubatingAttributes.DB_SYSTEM, "myDb"),
109-
entry(AttributeKey.stringKey("db.namespace"), "potatoes"),
110-
entry(AttributeKey.stringKey("db.query.text"), "SELECT * FROM potato"),
111-
entry(AttributeKey.stringKey("db.operation.name"), "SELECT"));
108+
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
109+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
110+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
112111
}
113112

114113
assertThat(endAttributes.build().isEmpty()).isTrue();

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractorTest.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package io.opentelemetry.instrumentation.api.incubator.semconv.db;
77

8-
import static io.opentelemetry.api.common.AttributeKey.stringKey;
98
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
109
import static org.assertj.core.api.Assertions.entry;
1110

@@ -88,10 +87,10 @@ void shouldExtractAllAttributes() {
8887
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM potato WHERE id=?"),
8988
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
9089
entry(DbIncubatingAttributes.DB_SQL_TABLE, "potato"),
91-
entry(stringKey("db.namespace"), "potatoes"),
92-
entry(stringKey("db.query.text"), "SELECT * FROM potato WHERE id=?"),
93-
entry(stringKey("db.operation.name"), "SELECT"),
94-
entry(stringKey("db.collection.name"), "potato"));
90+
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
91+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato WHERE id=?"),
92+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
93+
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"));
9594
} else if (SemconvStability.emitOldDatabaseSemconv()) {
9695
assertThat(startAttributes.build())
9796
.containsOnly(
@@ -106,10 +105,10 @@ void shouldExtractAllAttributes() {
106105
assertThat(startAttributes.build())
107106
.containsOnly(
108107
entry(DbIncubatingAttributes.DB_SYSTEM, "myDb"),
109-
entry(stringKey("db.namespace"), "potatoes"),
110-
entry(stringKey("db.query.text"), "SELECT * FROM potato WHERE id=?"),
111-
entry(stringKey("db.operation.name"), "SELECT"),
112-
entry(stringKey("db.collection.name"), "potato"));
108+
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
109+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato WHERE id=?"),
110+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
111+
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"));
113112
}
114113

115114
assertThat(endAttributes.build().isEmpty()).isTrue();
@@ -136,8 +135,8 @@ void shouldNotExtractTableIfAttributeIsNotSet() {
136135
.containsOnly(
137136
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT *"),
138137
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
139-
entry(stringKey("db.query.text"), "SELECT *"),
140-
entry(stringKey("db.operation.name"), "SELECT"));
138+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT *"),
139+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
141140
} else if (SemconvStability.emitOldDatabaseSemconv()) {
142141
assertThat(attributes.build())
143142
.containsOnly(
@@ -146,8 +145,8 @@ void shouldNotExtractTableIfAttributeIsNotSet() {
146145
} else if (SemconvStability.emitStableDatabaseSemconv()) {
147146
assertThat(attributes.build())
148147
.containsOnly(
149-
entry(stringKey("db.query.text"), "SELECT *"),
150-
entry(stringKey("db.operation.name"), "SELECT"));
148+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT *"),
149+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
151150
}
152151
}
153152

@@ -176,9 +175,9 @@ void shouldExtractTableToSpecifiedKey() {
176175
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM table"),
177176
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
178177
entry(DbIncubatingAttributes.DB_CASSANDRA_TABLE, "table"),
179-
entry(stringKey("db.query.text"), "SELECT * FROM table"),
180-
entry(stringKey("db.operation.name"), "SELECT"),
181-
entry(stringKey("db.collection.name"), "table"));
178+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM table"),
179+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
180+
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "table"));
182181
} else if (SemconvStability.emitOldDatabaseSemconv()) {
183182
assertThat(attributes.build())
184183
.containsOnly(
@@ -188,9 +187,9 @@ void shouldExtractTableToSpecifiedKey() {
188187
} else if (SemconvStability.emitStableDatabaseSemconv()) {
189188
assertThat(attributes.build())
190189
.containsOnly(
191-
entry(stringKey("db.query.text"), "SELECT * FROM table"),
192-
entry(stringKey("db.operation.name"), "SELECT"),
193-
entry(stringKey("db.collection.name"), "table"));
190+
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM table"),
191+
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
192+
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "table"));
194193
}
195194
}
196195

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

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
package io.opentelemetry.instrumentation.api.semconv.http;
77

88
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
9+
import static io.opentelemetry.semconv.ErrorAttributes.ERROR_TYPE;
10+
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
11+
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD_ORIGINAL;
12+
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_RESEND_COUNT;
13+
import static io.opentelemetry.semconv.HttpAttributes.HTTP_RESPONSE_STATUS_CODE;
14+
import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_ADDRESS;
15+
import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_PORT;
16+
import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PROTOCOL_NAME;
17+
import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PROTOCOL_VERSION;
18+
import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
19+
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
20+
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
921
import static java.util.Arrays.asList;
1022
import static java.util.Collections.emptyList;
1123
import static java.util.Collections.emptyMap;
@@ -18,11 +30,6 @@
1830
import io.opentelemetry.context.Context;
1931
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
2032
import io.opentelemetry.instrumentation.api.internal.HttpConstants;
21-
import io.opentelemetry.semconv.ErrorAttributes;
22-
import io.opentelemetry.semconv.HttpAttributes;
23-
import io.opentelemetry.semconv.NetworkAttributes;
24-
import io.opentelemetry.semconv.ServerAttributes;
25-
import io.opentelemetry.semconv.UrlAttributes;
2633
import java.net.ConnectException;
2734
import java.util.HashMap;
2835
import java.util.HashSet;
@@ -171,26 +178,26 @@ void normal() {
171178
extractor.onStart(startAttributes, Context.root(), request);
172179
assertThat(startAttributes.build())
173180
.containsOnly(
174-
entry(HttpAttributes.HTTP_REQUEST_METHOD, "POST"),
175-
entry(UrlAttributes.URL_FULL, "http://github.com"),
181+
entry(HTTP_REQUEST_METHOD, "POST"),
182+
entry(URL_FULL, "http://github.com"),
176183
entry(
177184
AttributeKey.stringArrayKey("http.request.header.custom-request-header"),
178185
asList("123", "456")),
179-
entry(ServerAttributes.SERVER_ADDRESS, "github.com"),
180-
entry(ServerAttributes.SERVER_PORT, 80L),
181-
entry(HttpAttributes.HTTP_REQUEST_RESEND_COUNT, 2L));
186+
entry(SERVER_ADDRESS, "github.com"),
187+
entry(SERVER_PORT, 80L),
188+
entry(HTTP_REQUEST_RESEND_COUNT, 2L));
182189

183190
AttributesBuilder endAttributes = Attributes.builder();
184191
extractor.onEnd(endAttributes, Context.root(), request, response, null);
185192
assertThat(endAttributes.build())
186193
.containsOnly(
187-
entry(HttpAttributes.HTTP_RESPONSE_STATUS_CODE, 202L),
194+
entry(HTTP_RESPONSE_STATUS_CODE, 202L),
188195
entry(
189196
AttributeKey.stringArrayKey("http.response.header.custom-response-header"),
190197
asList("654", "321")),
191-
entry(NetworkAttributes.NETWORK_PROTOCOL_VERSION, "1.1"),
192-
entry(NetworkAttributes.NETWORK_PEER_ADDRESS, "4.3.2.1"),
193-
entry(NetworkAttributes.NETWORK_PEER_PORT, 456L));
198+
entry(NETWORK_PROTOCOL_VERSION, "1.1"),
199+
entry(NETWORK_PEER_ADDRESS, "4.3.2.1"),
200+
entry(NETWORK_PEER_PORT, 456L));
194201
}
195202

196203
@ParameterizedTest
@@ -207,8 +214,8 @@ void shouldExtractKnownMethods(String requestMethod) {
207214
extractor.onEnd(attributes, Context.root(), request, emptyMap(), null);
208215

209216
assertThat(attributes.build())
210-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD, requestMethod)
211-
.doesNotContainKey(HttpAttributes.HTTP_REQUEST_METHOD_ORIGINAL);
217+
.containsEntry(HTTP_REQUEST_METHOD, requestMethod)
218+
.doesNotContainKey(HTTP_REQUEST_METHOD_ORIGINAL);
212219
}
213220

214221
@ParameterizedTest
@@ -225,8 +232,8 @@ void shouldTreatMethodsAsCaseSensitive(String requestMethod) {
225232
extractor.onEnd(attributes, Context.root(), request, emptyMap(), null);
226233

227234
assertThat(attributes.build())
228-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD, HttpConstants._OTHER)
229-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD_ORIGINAL, requestMethod);
235+
.containsEntry(HTTP_REQUEST_METHOD, HttpConstants._OTHER)
236+
.containsEntry(HTTP_REQUEST_METHOD_ORIGINAL, requestMethod);
230237
}
231238

232239
@ParameterizedTest
@@ -243,8 +250,8 @@ void shouldUseOtherForUnknownMethods(String requestMethod) {
243250
extractor.onEnd(attributes, Context.root(), request, emptyMap(), null);
244251

245252
assertThat(attributes.build())
246-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD, HttpConstants._OTHER)
247-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD_ORIGINAL, requestMethod);
253+
.containsEntry(HTTP_REQUEST_METHOD, HttpConstants._OTHER)
254+
.containsEntry(HTTP_REQUEST_METHOD_ORIGINAL, requestMethod);
248255
}
249256

250257
@ParameterizedTest
@@ -263,8 +270,8 @@ void shouldExtractKnownMethods_override(String requestMethod) {
263270
extractor.onEnd(attributes, Context.root(), request, emptyMap(), null);
264271

265272
assertThat(attributes.build())
266-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD, requestMethod)
267-
.doesNotContainKey(HttpAttributes.HTTP_REQUEST_METHOD_ORIGINAL);
273+
.containsEntry(HTTP_REQUEST_METHOD, requestMethod)
274+
.doesNotContainKey(HTTP_REQUEST_METHOD_ORIGINAL);
268275
}
269276

270277
@ParameterizedTest
@@ -283,8 +290,8 @@ void shouldUseOtherForUnknownMethods_override(String requestMethod) {
283290
extractor.onEnd(attributes, Context.root(), request, emptyMap(), null);
284291

285292
assertThat(attributes.build())
286-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD, HttpConstants._OTHER)
287-
.containsEntry(HttpAttributes.HTTP_REQUEST_METHOD_ORIGINAL, requestMethod);
293+
.containsEntry(HTTP_REQUEST_METHOD, HttpConstants._OTHER)
294+
.containsEntry(HTTP_REQUEST_METHOD_ORIGINAL, requestMethod);
288295
}
289296

290297
@Test
@@ -300,8 +307,8 @@ void shouldExtractErrorType_httpStatusCode() {
300307
extractor.onEnd(attributes, Context.root(), emptyMap(), response, null);
301308

302309
assertThat(attributes.build())
303-
.containsEntry(HttpAttributes.HTTP_RESPONSE_STATUS_CODE, 400)
304-
.containsEntry(ErrorAttributes.ERROR_TYPE, "400");
310+
.containsEntry(HTTP_RESPONSE_STATUS_CODE, 400)
311+
.containsEntry(ERROR_TYPE, "400");
305312
}
306313

307314
@Test
@@ -317,7 +324,7 @@ void shouldExtractErrorType_getter() {
317324
extractor.onStart(attributes, Context.root(), emptyMap());
318325
extractor.onEnd(attributes, Context.root(), request, emptyMap(), null);
319326

320-
assertThat(attributes.build()).containsEntry(ErrorAttributes.ERROR_TYPE, "custom error type");
327+
assertThat(attributes.build()).containsEntry(ERROR_TYPE, "custom error type");
321328
}
322329

323330
@Test
@@ -329,8 +336,7 @@ void shouldExtractErrorType_exceptionClassName() {
329336
extractor.onStart(attributes, Context.root(), emptyMap());
330337
extractor.onEnd(attributes, Context.root(), emptyMap(), emptyMap(), new ConnectException());
331338

332-
assertThat(attributes.build())
333-
.containsEntry(ErrorAttributes.ERROR_TYPE, "java.net.ConnectException");
339+
assertThat(attributes.build()).containsEntry(ERROR_TYPE, "java.net.ConnectException");
334340
}
335341

336342
@Test
@@ -342,7 +348,7 @@ void shouldExtractErrorType_other() {
342348
extractor.onStart(attributes, Context.root(), emptyMap());
343349
extractor.onEnd(attributes, Context.root(), emptyMap(), emptyMap(), null);
344350

345-
assertThat(attributes.build()).containsEntry(ErrorAttributes.ERROR_TYPE, HttpConstants._OTHER);
351+
assertThat(attributes.build()).containsEntry(ERROR_TYPE, HttpConstants._OTHER);
346352
}
347353

348354
@Test
@@ -359,14 +365,11 @@ void shouldExtractServerAddressAndPortFromHostHeader() {
359365
AttributesBuilder startAttributes = Attributes.builder();
360366
extractor.onStart(startAttributes, Context.root(), request);
361367
assertThat(startAttributes.build())
362-
.containsOnly(
363-
entry(ServerAttributes.SERVER_ADDRESS, "github.com"),
364-
entry(ServerAttributes.SERVER_PORT, 123L));
368+
.containsOnly(entry(SERVER_ADDRESS, "github.com"), entry(SERVER_PORT, 123L));
365369

366370
AttributesBuilder endAttributes = Attributes.builder();
367371
extractor.onEnd(endAttributes, Context.root(), request, response, null);
368-
assertThat(endAttributes.build())
369-
.containsOnly(entry(HttpAttributes.HTTP_RESPONSE_STATUS_CODE, 200L));
372+
assertThat(endAttributes.build()).containsOnly(entry(HTTP_RESPONSE_STATUS_CODE, 200L));
370373
}
371374

372375
@Test
@@ -386,17 +389,15 @@ void shouldExtractPeerAddressEvenIfItDuplicatesServerAddress() {
386389
AttributesBuilder startAttributes = Attributes.builder();
387390
extractor.onStart(startAttributes, Context.root(), request);
388391
assertThat(startAttributes.build())
389-
.containsOnly(
390-
entry(ServerAttributes.SERVER_ADDRESS, "1.2.3.4"),
391-
entry(ServerAttributes.SERVER_PORT, 123L));
392+
.containsOnly(entry(SERVER_ADDRESS, "1.2.3.4"), entry(SERVER_PORT, 123L));
392393

393394
AttributesBuilder endAttributes = Attributes.builder();
394395
extractor.onEnd(endAttributes, Context.root(), request, response, null);
395396
assertThat(endAttributes.build())
396397
.containsOnly(
397-
entry(HttpAttributes.HTTP_RESPONSE_STATUS_CODE, 200L),
398-
entry(NetworkAttributes.NETWORK_PEER_ADDRESS, "1.2.3.4"),
399-
entry(NetworkAttributes.NETWORK_PEER_PORT, 456L));
398+
entry(HTTP_RESPONSE_STATUS_CODE, 200L),
399+
entry(NETWORK_PEER_ADDRESS, "1.2.3.4"),
400+
entry(NETWORK_PEER_PORT, 456L));
400401
}
401402

402403
@Test
@@ -419,8 +420,8 @@ void shouldExtractProtocolNameDifferentFromHttp() {
419420
extractor.onEnd(endAttributes, Context.root(), request, response, null);
420421
assertThat(endAttributes.build())
421422
.containsOnly(
422-
entry(HttpAttributes.HTTP_RESPONSE_STATUS_CODE, 200L),
423-
entry(NetworkAttributes.NETWORK_PROTOCOL_NAME, "spdy"),
424-
entry(NetworkAttributes.NETWORK_PROTOCOL_VERSION, "3.1"));
423+
entry(HTTP_RESPONSE_STATUS_CODE, 200L),
424+
entry(NETWORK_PROTOCOL_NAME, "spdy"),
425+
entry(NETWORK_PROTOCOL_VERSION, "3.1"));
425426
}
426427
}

0 commit comments

Comments
 (0)