@@ -538,15 +538,16 @@ func (c *mountStatsCollector) Update(ch chan<- prometheus.Metric) error {
538538 mountAddress = miStats .SuperOptions ["addr" ]
539539 }
540540
541- deviceIdentifier := nfsDeviceIdentifier {m .Device , stats .Transport .Protocol , mountAddress }
542- i := deviceList [deviceIdentifier ]
543- if i {
544- level .Debug (c .logger ).Log ("msg" , "Skipping duplicate device entry" , "device" , deviceIdentifier )
545- continue
541+ for k := range stats .Transport {
542+ deviceIdentifier := nfsDeviceIdentifier {m .Device , stats .Transport [k ].Protocol , mountAddress }
543+ i := deviceList [deviceIdentifier ]
544+ if i {
545+ level .Debug (c .logger ).Log ("msg" , "Skipping duplicate device entry" , "device" , deviceIdentifier )
546+ break
547+ }
548+ deviceList [deviceIdentifier ] = true
549+ c .updateNFSStats (ch , stats , m .Device , stats .Transport [k ].Protocol , mountAddress )
546550 }
547-
548- deviceList [deviceIdentifier ] = true
549- c .updateNFSStats (ch , stats , m .Device , stats .Transport .Protocol , mountAddress )
550551 }
551552
552553 return nil
@@ -617,75 +618,77 @@ func (c *mountStatsCollector) updateNFSStats(ch chan<- prometheus.Metric, s *pro
617618 labelValues ... ,
618619 )
619620
620- ch <- prometheus .MustNewConstMetric (
621- c .NFSTransportBindTotal ,
622- prometheus .CounterValue ,
623- float64 (s .Transport .Bind ),
624- labelValues ... ,
625- )
621+ for i := range s .Transport {
622+ ch <- prometheus .MustNewConstMetric (
623+ c .NFSTransportBindTotal ,
624+ prometheus .CounterValue ,
625+ float64 (s .Transport [i ].Bind ),
626+ labelValues ... ,
627+ )
626628
627- ch <- prometheus .MustNewConstMetric (
628- c .NFSTransportConnectTotal ,
629- prometheus .CounterValue ,
630- float64 (s .Transport .Connect ),
631- labelValues ... ,
632- )
629+ ch <- prometheus .MustNewConstMetric (
630+ c .NFSTransportConnectTotal ,
631+ prometheus .CounterValue ,
632+ float64 (s .Transport [ i ] .Connect ),
633+ labelValues ... ,
634+ )
633635
634- ch <- prometheus .MustNewConstMetric (
635- c .NFSTransportIdleTimeSeconds ,
636- prometheus .GaugeValue ,
637- float64 (s .Transport .IdleTimeSeconds % float64Mantissa ),
638- labelValues ... ,
639- )
636+ ch <- prometheus .MustNewConstMetric (
637+ c .NFSTransportIdleTimeSeconds ,
638+ prometheus .GaugeValue ,
639+ float64 (s .Transport [ i ] .IdleTimeSeconds % float64Mantissa ),
640+ labelValues ... ,
641+ )
640642
641- ch <- prometheus .MustNewConstMetric (
642- c .NFSTransportSendsTotal ,
643- prometheus .CounterValue ,
644- float64 (s .Transport .Sends ),
645- labelValues ... ,
646- )
643+ ch <- prometheus .MustNewConstMetric (
644+ c .NFSTransportSendsTotal ,
645+ prometheus .CounterValue ,
646+ float64 (s .Transport [ i ] .Sends ),
647+ labelValues ... ,
648+ )
647649
648- ch <- prometheus .MustNewConstMetric (
649- c .NFSTransportReceivesTotal ,
650- prometheus .CounterValue ,
651- float64 (s .Transport .Receives ),
652- labelValues ... ,
653- )
650+ ch <- prometheus .MustNewConstMetric (
651+ c .NFSTransportReceivesTotal ,
652+ prometheus .CounterValue ,
653+ float64 (s .Transport [ i ] .Receives ),
654+ labelValues ... ,
655+ )
654656
655- ch <- prometheus .MustNewConstMetric (
656- c .NFSTransportBadTransactionIDsTotal ,
657- prometheus .CounterValue ,
658- float64 (s .Transport .BadTransactionIDs ),
659- labelValues ... ,
660- )
657+ ch <- prometheus .MustNewConstMetric (
658+ c .NFSTransportBadTransactionIDsTotal ,
659+ prometheus .CounterValue ,
660+ float64 (s .Transport [ i ] .BadTransactionIDs ),
661+ labelValues ... ,
662+ )
661663
662- ch <- prometheus .MustNewConstMetric (
663- c .NFSTransportBacklogQueueTotal ,
664- prometheus .CounterValue ,
665- float64 (s .Transport .CumulativeBacklog ),
666- labelValues ... ,
667- )
664+ ch <- prometheus .MustNewConstMetric (
665+ c .NFSTransportBacklogQueueTotal ,
666+ prometheus .CounterValue ,
667+ float64 (s .Transport [ i ] .CumulativeBacklog ),
668+ labelValues ... ,
669+ )
668670
669- ch <- prometheus .MustNewConstMetric (
670- c .NFSTransportMaximumRPCSlots ,
671- prometheus .GaugeValue ,
672- float64 (s .Transport .MaximumRPCSlotsUsed ),
673- labelValues ... ,
674- )
671+ ch <- prometheus .MustNewConstMetric (
672+ c .NFSTransportMaximumRPCSlots ,
673+ prometheus .GaugeValue ,
674+ float64 (s .Transport [ i ] .MaximumRPCSlotsUsed ),
675+ labelValues ... ,
676+ )
675677
676- ch <- prometheus .MustNewConstMetric (
677- c .NFSTransportSendingQueueTotal ,
678- prometheus .CounterValue ,
679- float64 (s .Transport .CumulativeSendingQueue ),
680- labelValues ... ,
681- )
678+ ch <- prometheus .MustNewConstMetric (
679+ c .NFSTransportSendingQueueTotal ,
680+ prometheus .CounterValue ,
681+ float64 (s .Transport [ i ] .CumulativeSendingQueue ),
682+ labelValues ... ,
683+ )
682684
683- ch <- prometheus .MustNewConstMetric (
684- c .NFSTransportPendingQueueTotal ,
685- prometheus .CounterValue ,
686- float64 (s .Transport .CumulativePendingQueue ),
687- labelValues ... ,
688- )
685+ ch <- prometheus .MustNewConstMetric (
686+ c .NFSTransportPendingQueueTotal ,
687+ prometheus .CounterValue ,
688+ float64 (s .Transport [i ].CumulativePendingQueue ),
689+ labelValues ... ,
690+ )
691+ }
689692
690693 for _ , op := range s .Operations {
691694 opLabelValues := []string {export , protocol , mountAddress , op .Operation }
0 commit comments