|
|
|
@ -538,15 +538,16 @@ func (c *mountStatsCollector) Update(ch chan<- prometheus.Metric) error {
|
|
|
|
|
mountAddress = miStats.SuperOptions["addr"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deviceIdentifier := nfsDeviceIdentifier{m.Device, stats.Transport.Protocol, mountAddress}
|
|
|
|
|
i := deviceList[deviceIdentifier]
|
|
|
|
|
if i {
|
|
|
|
|
level.Debug(c.logger).Log("msg", "Skipping duplicate device entry", "device", deviceIdentifier)
|
|
|
|
|
continue
|
|
|
|
|
for k := range stats.Transport {
|
|
|
|
|
deviceIdentifier := nfsDeviceIdentifier{m.Device, stats.Transport[k].Protocol, mountAddress}
|
|
|
|
|
i := deviceList[deviceIdentifier]
|
|
|
|
|
if i {
|
|
|
|
|
level.Debug(c.logger).Log("msg", "Skipping duplicate device entry", "device", deviceIdentifier)
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
deviceList[deviceIdentifier] = true
|
|
|
|
|
c.updateNFSStats(ch, stats, m.Device, stats.Transport[k].Protocol, mountAddress)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deviceList[deviceIdentifier] = true
|
|
|
|
|
c.updateNFSStats(ch, stats, m.Device, stats.Transport.Protocol, mountAddress)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
@ -617,75 +618,77 @@ func (c *mountStatsCollector) updateNFSStats(ch chan<- prometheus.Metric, s *pro
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportBindTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.Bind),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
for i := range s.Transport {
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportBindTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].Bind),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportConnectTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.Connect),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportConnectTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].Connect),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportIdleTimeSeconds,
|
|
|
|
|
prometheus.GaugeValue,
|
|
|
|
|
float64(s.Transport.IdleTimeSeconds%float64Mantissa),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportIdleTimeSeconds,
|
|
|
|
|
prometheus.GaugeValue,
|
|
|
|
|
float64(s.Transport[i].IdleTimeSeconds%float64Mantissa),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportSendsTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.Sends),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportSendsTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].Sends),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportReceivesTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.Receives),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportReceivesTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].Receives),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportBadTransactionIDsTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.BadTransactionIDs),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportBadTransactionIDsTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].BadTransactionIDs),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportBacklogQueueTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.CumulativeBacklog),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportBacklogQueueTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].CumulativeBacklog),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportMaximumRPCSlots,
|
|
|
|
|
prometheus.GaugeValue,
|
|
|
|
|
float64(s.Transport.MaximumRPCSlotsUsed),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportMaximumRPCSlots,
|
|
|
|
|
prometheus.GaugeValue,
|
|
|
|
|
float64(s.Transport[i].MaximumRPCSlotsUsed),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportSendingQueueTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.CumulativeSendingQueue),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportSendingQueueTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].CumulativeSendingQueue),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportPendingQueueTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport.CumulativePendingQueue),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
|
c.NFSTransportPendingQueueTotal,
|
|
|
|
|
prometheus.CounterValue,
|
|
|
|
|
float64(s.Transport[i].CumulativePendingQueue),
|
|
|
|
|
labelValues...,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, op := range s.Operations {
|
|
|
|
|
opLabelValues := []string{export, protocol, mountAddress, op.Operation}
|
|
|
|
|