@@ -109,13 +109,13 @@ func (m *MetricsCollectorSchedule) Collect(ctx context.Context, callback chan<-
109109 scheduleMetricList := prometheusCommon .NewMetricsList ()
110110
111111 for {
112- m .CollectorReference . logger .Debugf ("fetch schedules (offset: %v, limit:%v)" , listOpts .Offset , listOpts .Limit )
112+ m .logger () .Debugf ("fetch schedules (offset: %v, limit:%v)" , listOpts .Offset , listOpts .Limit )
113113
114114 list , err := PagerDutyClient .ListSchedules (listOpts )
115115 m .CollectorReference .PrometheusAPICounter ().WithLabelValues ("ListSchedules" ).Inc ()
116116
117117 if err != nil {
118- panic (err )
118+ m . logger (). Panic (err )
119119 }
120120
121121 for _ , schedule := range list .Schedules {
@@ -152,13 +152,13 @@ func (m *MetricsCollectorSchedule) collectScheduleInformation(scheduleID string,
152152 listOpts .Until = filterUntil .Format (time .RFC3339 )
153153 listOpts .Offset = 0
154154
155- m .CollectorReference . logger .Debugf ("fetch schedule information (schedule: %v, offset: %v, limit:%v)" , scheduleID , listOpts .Offset , listOpts .Limit )
155+ m .logger () .Debugf ("fetch schedule information (schedule: %v, offset: %v, limit:%v)" , scheduleID , listOpts .Offset , listOpts .Limit )
156156
157157 schedule , err := PagerDutyClient .GetSchedule (scheduleID , listOpts )
158158 m .CollectorReference .PrometheusAPICounter ().WithLabelValues ("GetSchedule" ).Inc ()
159159
160160 if err != nil {
161- panic (err )
161+ m . logger (). Panic (err )
162162 }
163163
164164 scheduleLayerMetricList := prometheusCommon .NewMetricsList ()
@@ -257,13 +257,13 @@ func (m *MetricsCollectorSchedule) collectScheduleOverrides(scheduleID string, c
257257 overrideMetricList := prometheusCommon .NewMetricsList ()
258258
259259 for {
260- m .CollectorReference . logger .Debugf ("fetch schedule overrides (schedule: %v, offset: %v, limit:%v)" , scheduleID , listOpts .Offset , listOpts .Limit )
260+ m .logger () .Debugf ("fetch schedule overrides (schedule: %v, offset: %v, limit:%v)" , scheduleID , listOpts .Offset , listOpts .Limit )
261261
262262 list , err := PagerDutyClient .ListOverrides (scheduleID , listOpts )
263263 m .CollectorReference .PrometheusAPICounter ().WithLabelValues ("ListOverrides" ).Inc ()
264264
265265 if err != nil {
266- panic (err )
266+ m . logger (). Panic (err )
267267 }
268268
269269 for _ , override := range list .Overrides {
0 commit comments