@@ -158,7 +158,11 @@ func (e *Exporter) RefreshMetrics() ([]prometheus.Labels, error) {
158158 // check monitoring point status and set it as ZERO if it was incorrect
159159 if item .Status > 1 || item .Status < 0 {
160160 e .log .WithFields (
161- logrus.Fields {"mp_id" : item .ID , "mp_name" : item .Name }).Errorf ("incorrect monitoring points status: %d" , item .Status )
161+ logrus.Fields {
162+ "mp_id" : item .ID ,
163+ "mp_name" : item .Name ,
164+ "status" : item .Status ,
165+ }).Errorf ("incorrect monitoring points status: %d" , item .Status )
162166 item .Status = 0
163167 }
164168
@@ -186,8 +190,21 @@ func (e *Exporter) processTaskStatResults(taskStatResults *client.TaskStatEntry)
186190// processTaskStatGraphResultItem processes one record (monitoring point) and updates metrics.
187191func (e * Exporter ) processTaskStatGraphResultItem (item * client.MonitoringPointEntry , refreshStartTime time.Time ) []prometheus.Labels {
188192 if len (item .Result ) == 0 {
193+ locationName := item .Name
194+ if e .Config .EngMPNames {
195+ locationName = translator .GetEngLocation (item .Name )
196+ }
197+ MPDataStatus .WithLabelValues (
198+ strconv .Itoa (e .taskInfo .ID ),
199+ e .taskInfo .ServiceName ,
200+ item .ID ,
201+ locationName ,
202+ ).Set (0 )
203+
189204 e .log .WithFields (
190- logrus.Fields {"mp_id" : item .ID , "mp_name" : item .Name }).Warn ("No results found for MP" )
205+ logrus.Fields {
206+ "mp_id" : item .ID ,
207+ "mp_name" : item .Name }).Warn ("No results found for MP" )
191208 return nil
192209 }
193210
@@ -198,6 +215,14 @@ func (e *Exporter) processTaskStatGraphResultItem(item *client.MonitoringPointEn
198215 e .updateMetrics (res , labels , item .Status , refreshStartTime )
199216 processedLabels = append (processedLabels , labels )
200217 }
218+
219+ MPDataStatus .WithLabelValues (
220+ strconv .Itoa (e .taskInfo .ID ),
221+ e .taskInfo .ServiceName ,
222+ item .ID ,
223+ processedLabels [0 ][LabelMPName ],
224+ ).Set (1 )
225+
201226 return processedLabels
202227}
203228
0 commit comments