File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
main/java/com/netflix/spectator/ipc
test/java/com/netflix/spectator/ipc Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -639,7 +639,7 @@ private IpcAttemptFinal getAttemptFinal() {
639639
640640 private String getEndpoint () {
641641 return (endpoint == null )
642- ? (path == null ) ? "unknown" : PathSanitizer .sanitize (path )
642+ ? (path == null || httpStatus == 404 ) ? "unknown" : PathSanitizer .sanitize (path )
643643 : endpoint ;
644644 }
645645
Original file line number Diff line number Diff line change @@ -225,6 +225,17 @@ public void endpointViaUri() {
225225 Assertions .assertEquals ("_api_v1_-" , actual );
226226 }
227227
228+ @ Test
229+ public void endpointViaUri404 () {
230+ String path = "/api/v1/1234567890" ;
231+ String actual = (String ) entry
232+ .withUri (URI .create (path ))
233+ .withHttpStatus (404 )
234+ .convert (this ::toMap )
235+ .get ("endpoint" );
236+ Assertions .assertEquals ("unknown" , actual );
237+ }
238+
228239 @ Test
229240 public void clientNode () {
230241 String expected = "i-12345" ;
You can’t perform that action at this time.
0 commit comments