@@ -76,7 +76,7 @@ func (h *ciHandler) Unavailable(from, to *backend.SampleResult) {
7676 & v1.ObjectReference {Kind : "OpenShiftTest" , Namespace : "kube-system" , Name : h .descriptor .Name ()},
7777 nil , v1 .EventTypeWarning , string (eventReason ), "detected" , message .BuildString ())
7878
79- interval := monitorapi .NewInterval (monitorapi . SourceDisruption , level ).Locator (h .descriptor .DisruptionLocator ()).
79+ interval := monitorapi .NewInterval (h . getSource () , level ).Locator (h .descriptor .DisruptionLocator ()).
8080 Display ().
8181 Message (message ).Build (fs .StartedAt , time.Time {})
8282 openIntervalID := h .monitorRecorder .StartInterval (interval )
@@ -100,8 +100,16 @@ func (h *ciHandler) Available(from, to *backend.SampleResult) {
100100 h .eventRecorder .Eventf (
101101 & v1.ObjectReference {Kind : "OpenShiftTest" , Namespace : "kube-system" , Name : h .descriptor .Name ()}, nil ,
102102 v1 .EventTypeNormal , string (monitorapi .DisruptionEndedEventReason ), "detected" , message .BuildString ())
103- interval := monitorapi .NewInterval (monitorapi . SourceDisruption , monitorapi .Info ).Locator (h .descriptor .DisruptionLocator ()).
103+ interval := monitorapi .NewInterval (h . getSource () , monitorapi .Info ).Locator (h .descriptor .DisruptionLocator ()).
104104 Message (message ).Build (fs .StartedAt , time.Time {})
105105 openIntervalID := h .monitorRecorder .StartInterval (interval )
106106 h .monitorRecorder .EndInterval (openIntervalID , ts .StartedAt )
107107}
108+
109+ // getSource returns the source of the interval based on the load balancer type. Localhost disruptions need to be separated, as in some cases these are expected
110+ func (h * ciHandler ) getSource () monitorapi.IntervalSource {
111+ if h .descriptor .GetLoadBalancerType () == backend .LocalhostType {
112+ return monitorapi .SourceDisruptionLocalhost
113+ }
114+ return monitorapi .SourceDisruption
115+ }
0 commit comments