@@ -241,14 +241,14 @@ func createEventReceiverFunction(f *FanoutEventHandler) func(context.Context, ch
241241 h .Set (apis .KnNamespaceHeader , ref .Namespace )
242242 // Any returned error is already logged in f.dispatch().
243243 dispatchResultForFanout := f .dispatch (ctx , subs , e , h )
244- _ = ParseDispatchResultAndReportMetrics ( dispatchResultForFanout , * r , * args )
244+
245245 // If there are both http and https subscribers, we need to report the metrics for both of the type
246246 if hasHttpSubs {
247- reportArgs .EventScheme = "http"
247+ args .EventScheme = "http"
248248 _ = ParseDispatchResultAndReportMetrics (dispatchResultForFanout , * r , * args )
249249 }
250250 if hasHttpsSubs {
251- reportArgs .EventScheme = "https"
251+ args .EventScheme = "https"
252252 _ = ParseDispatchResultAndReportMetrics (dispatchResultForFanout , * r , * args )
253253 }
254254 }(evnt , additionalHeaders , parentSpan , & f .reporter , & reportArgs )
@@ -272,9 +272,9 @@ func createEventReceiverFunction(f *FanoutEventHandler) func(context.Context, ch
272272
273273 additionalHeaders .Set (apis .KnNamespaceHeader , ref .Namespace )
274274 dispatchResultForFanout := f .dispatch (ctx , subs , event , additionalHeaders )
275- err := ParseDispatchResultAndReportMetrics (dispatchResultForFanout , f .reporter , reportArgs )
276275 // If there are both http and https subscribers, we need to report the metrics for both of the type
277276 // In this case we report http metrics because above we checked first for https and reported it so the left over metric to report is for http
277+ var err error
278278 if hasHttpSubs {
279279 reportArgs .EventScheme = "http"
280280 err = ParseDispatchResultAndReportMetrics (dispatchResultForFanout , f .reporter , reportArgs )
0 commit comments