@@ -19,27 +19,30 @@ func (lt *LoggingTransport) RoundTrip(req *http.Request) (*http.Response, error)
19
19
}
20
20
21
21
start := time .Now ()
22
-
23
22
resp , err := rt .RoundTrip (req )
24
- switch {
25
- case err != nil :
26
- slog .Info ("HTTP error" ,
27
- slog .String ("method" , req .Method ),
28
- slog .String ("url" , req .URL .String ()),
29
- slog .Duration ("duration" , time .Since (start )),
30
- slog .String ("error" , err .Error ()))
31
- case resp .StatusCode < 300 :
32
- slog .Info ("HTTP error response" ,
33
- slog .String ("method" , req .Method ),
34
- slog .String ("url" , req .URL .String ()),
35
- slog .Duration ("duration" , time .Since (start )),
36
- slog .String ("status" , resp .Status ))
37
- default :
38
- slog .Debug ("HTTP success response" ,
39
- slog .String ("method" , req .Method ),
40
- slog .String ("url" , req .URL .String ()),
41
- slog .Duration ("duration" , time .Since (start )),
42
- slog .String ("status" , resp .Status ))
23
+
24
+ // don't log health checks
25
+ if req .URL .Path != "/v1/sys/health" {
26
+ switch {
27
+ case err != nil :
28
+ slog .Info ("HTTP error" ,
29
+ slog .String ("method" , req .Method ),
30
+ slog .String ("url" , req .URL .String ()),
31
+ slog .Duration ("duration" , time .Since (start )),
32
+ slog .String ("error" , err .Error ()))
33
+ case resp .StatusCode >= 300 :
34
+ slog .Info ("HTTP error response" ,
35
+ slog .String ("method" , req .Method ),
36
+ slog .String ("url" , req .URL .String ()),
37
+ slog .Duration ("duration" , time .Since (start )),
38
+ slog .String ("status" , resp .Status ))
39
+ default :
40
+ slog .Debug ("HTTP success response" ,
41
+ slog .String ("method" , req .Method ),
42
+ slog .String ("url" , req .URL .String ()),
43
+ slog .Duration ("duration" , time .Since (start )),
44
+ slog .String ("status" , resp .Status ))
45
+ }
43
46
}
44
47
45
48
return resp , err
0 commit comments