@@ -58,7 +58,7 @@ func (r *ProbeResult) failureInfoGauge() *prometheus.GaugeVec {
5858 } else if r .failureReason == "" {
5959 // Should not happen, but there theoretically might be an
6060 // inconsistent state of the struct.
61- r .failureReason = "unknown "
61+ r .failureReason = "Unkown "
6262 }
6363
6464 labels := []string {"reason" }
@@ -85,15 +85,18 @@ func (r *ProbeResult) log(logger *slog.Logger, duration float64) {
8585 if r .failureReason == "" {
8686 // Should not happen, but there theoretically might be an
8787 // inconsistent state of the struct.
88- r .failureReason = "unknown "
88+ r .failureReason = "Probe failed for unkown reason "
8989 }
9090 // converting the []string slice to an []any slice is a bit finicky
91- logDetails := make ([]any , 0 , len (r .failureDetails )+ 2 )
91+ logDetails := make ([]any , 0 , len (r .failureDetails )+ 4 )
92+ logDetails = append (logDetails , "reason" )
93+ logDetails = append (logDetails , r .failureReason )
9294 for _ , d := range r .failureDetails {
9395 logDetails = append (logDetails , d )
9496 }
95- logger .Error (r .failureReason , logDetails ... )
96- logger .Error ("Probe failed" , "duration_seconds" , duration )
97+ logDetails = append (logDetails , "duration" )
98+ logDetails = append (logDetails , duration )
99+ logger .Error ("Probe failed" , logDetails ... )
97100 }
98101}
99102
0 commit comments