@@ -182,19 +182,25 @@ func (c *SolidfireCollector) collectVolumeMeta(ctx context.Context, ch chan<- pr
182182 mu .Lock ()
183183 defer mu .Unlock ()
184184
185- ch <- prometheus .MustNewConstMetric (
186- MetricDescriptions .VolumeCount ,
187- prometheus .CounterValue ,
188- float64 (len (volumes .Result .Volumes )),
189- )
185+ volumeCntByStatus := map [string ]int {}
190186
191187 for _ , vol := range volumes .Result .Volumes {
192188 c .volumeNamesByID [vol .VolumeID ] = vol .Name
189+ volumeCntByStatus [vol .Status ]++
190+ }
191+
192+ for status , count := range volumeCntByStatus {
193+ ch <- prometheus .MustNewConstMetric (
194+ MetricDescriptions .VolumeCount ,
195+ prometheus .CounterValue ,
196+ float64 (count ),
197+ status ,
198+ )
193199 }
194200 return nil
195201}
196- func (c * SolidfireCollector ) collectNodeMeta (ctx context.Context , ch chan <- prometheus.Metric ) error {
197202
203+ func (c * SolidfireCollector ) collectNodeMeta (ctx context.Context , ch chan <- prometheus.Metric ) error {
198204 nodes , err := c .client .ListAllNodes (ctx )
199205 if err != nil {
200206 return err
@@ -410,6 +416,7 @@ func (c *SolidfireCollector) collectVolumeStats(ctx context.Context, ch chan<- p
410416 }
411417 return nil
412418}
419+
413420func (c * SolidfireCollector ) collectClusterCapacity (ctx context.Context , ch chan <- prometheus.Metric ) error {
414421 clusterCapacity , err := c .client .GetClusterCapacity (ctx )
415422 if err != nil {
@@ -562,6 +569,7 @@ func (c *SolidfireCollector) collectClusterCapacity(ctx context.Context, ch chan
562569 clusterThinProvisioningFactor * clusterDeDuplicationFactor * clusterCompressionFactor )
563570 return nil
564571}
572+
565573func (c * SolidfireCollector ) collectClusterFaults (ctx context.Context , ch chan <- prometheus.Metric ) error {
566574 ClusterActiveFaults , err := c .client .ListClusterFaults (ctx )
567575 if err != nil {
@@ -588,6 +596,7 @@ func (c *SolidfireCollector) collectClusterFaults(ctx context.Context, ch chan<-
588596 }
589597 return nil
590598}
599+
591600func (c * SolidfireCollector ) collectClusterNodeStats (ctx context.Context , ch chan <- prometheus.Metric ) error {
592601 ClusterNodeStats , err := c .client .ListNodeStats (ctx )
593602 if err != nil {
@@ -752,6 +761,7 @@ func (c *SolidfireCollector) collectClusterNodeStats(ctx context.Context, ch cha
752761 }
753762 return nil
754763}
764+
755765func (c * SolidfireCollector ) collectVolumeQosHistograms (ctx context.Context , ch chan <- prometheus.Metric ) error {
756766 VolumeQoSHistograms , err := c .client .ListVolumeQoSHistograms (ctx )
757767 if err != nil {
@@ -871,6 +881,7 @@ func (c *SolidfireCollector) collectVolumeQosHistograms(ctx context.Context, ch
871881 }
872882 return nil
873883}
884+
874885func (c * SolidfireCollector ) collectClusterStats (ctx context.Context , ch chan <- prometheus.Metric ) error {
875886 clusterStats , err := c .client .GetClusterStats (ctx )
876887 if err != nil {
@@ -1192,6 +1203,7 @@ func (c *SolidfireCollector) collectClusterFullThreshold(ctx context.Context, ch
11921203 )
11931204 return nil
11941205}
1206+
11951207func (c * SolidfireCollector ) collectDriveDetails (ctx context.Context , ch chan <- prometheus.Metric ) error {
11961208 ListDrives , err := c .client .ListDrives (ctx )
11971209 if err != nil {
@@ -1233,6 +1245,7 @@ func (c *SolidfireCollector) collectDriveDetails(ctx context.Context, ch chan<-
12331245 }
12341246 return nil
12351247}
1248+
12361249func (c * SolidfireCollector ) collectISCSISessions (ctx context.Context , ch chan <- prometheus.Metric ) error {
12371250 ListISCSISessions , err := c .client .ListISCSISessions (ctx )
12381251 if err != nil {
@@ -1294,6 +1307,7 @@ func (c *SolidfireCollector) collectInitiators(ctx context.Context, ch chan<- pr
12941307 )
12951308 return nil
12961309}
1310+
12971311func (c * SolidfireCollector ) collectVolumeAccessGroups (ctx context.Context , ch chan <- prometheus.Metric ) error {
12981312 volumeAccessGroups , err := c .client .ListVolumeAccessGroups (ctx )
12991313 if err != nil {
0 commit comments