Merge branch '6.1.x'

This commit is contained in:
Brian Clozel
2024-10-18 14:43:54 +02:00
2 changed files with 21 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -137,4 +137,16 @@ class DefaultServerRequestObservationConventionTests {
.contains(KeyValue.of("http.url", "/test"));
}
@Test
void addsKeyValuesForInvalidStatusExchange() {
this.request.setRequestURI("/test/invalidStatus");
this.response.setStatus(0);
assertThat(this.convention.getLowCardinalityKeyValues(this.context)).hasSize(5)
.contains(KeyValue.of("method", "GET"), KeyValue.of("uri", "UNKNOWN"), KeyValue.of("status", "0"),
KeyValue.of("exception", "none"), KeyValue.of("outcome", "UNKNOWN"));
assertThat(this.convention.getHighCardinalityKeyValues(this.context)).hasSize(1)
.contains(KeyValue.of("http.url", "/test/invalidStatus"));
}
}