@@ -582,9 +582,15 @@ func (c *rdsCollector) Collect(ch chan<- prometheus.Metric) {
582582 instance .CACertificateIdentifier ,
583583 instance .Arn ,
584584 )
585- ch <- prometheus .MustNewConstMetric (c .maxAllocatedStorage , prometheus .GaugeValue , float64 (instance .MaxAllocatedStorage ), c .awsAccountID , c .awsRegion , dbidentifier )
586- ch <- prometheus .MustNewConstMetric (c .allocatedDiskIOPS , prometheus .GaugeValue , float64 (instance .MaxIops ), c .awsAccountID , c .awsRegion , dbidentifier )
587- ch <- prometheus .MustNewConstMetric (c .allocatedDiskThroughput , prometheus .GaugeValue , float64 (instance .StorageThroughput ), c .awsAccountID , c .awsRegion , dbidentifier )
585+ if instance .MaxAllocatedStorage > 0 {
586+ ch <- prometheus .MustNewConstMetric (c .maxAllocatedStorage , prometheus .GaugeValue , float64 (instance .MaxAllocatedStorage ), c .awsAccountID , c .awsRegion , dbidentifier )
587+ }
588+ if instance .MaxIops > 0 {
589+ ch <- prometheus .MustNewConstMetric (c .allocatedDiskIOPS , prometheus .GaugeValue , float64 (instance .MaxIops ), c .awsAccountID , c .awsRegion , dbidentifier )
590+ }
591+ if instance .StorageThroughput > 0 {
592+ ch <- prometheus .MustNewConstMetric (c .allocatedDiskThroughput , prometheus .GaugeValue , float64 (instance .StorageThroughput ), c .awsAccountID , c .awsRegion , dbidentifier )
593+ }
588594 ch <- prometheus .MustNewConstMetric (c .status , prometheus .GaugeValue , float64 (instance .Status ), c .awsAccountID , c .awsRegion , dbidentifier )
589595 ch <- prometheus .MustNewConstMetric (c .backupRetentionPeriod , prometheus .GaugeValue , float64 (instance .BackupRetentionPeriod ), c .awsAccountID , c .awsRegion , dbidentifier )
590596
@@ -597,8 +603,12 @@ func (c *rdsCollector) Collect(ch chan<- prometheus.Metric) {
597603 storageThroughput = min (float64 (instance .StorageThroughput ), ec2Metrics .BaselineThroughput )
598604 }
599605
600- ch <- prometheus .MustNewConstMetric (c .maxIops , prometheus .GaugeValue , float64 (maxIops ), c .awsAccountID , c .awsRegion , dbidentifier )
601- ch <- prometheus .MustNewConstMetric (c .storageThroughput , prometheus .GaugeValue , storageThroughput , c .awsAccountID , c .awsRegion , dbidentifier )
606+ if maxIops > 0 {
607+ ch <- prometheus .MustNewConstMetric (c .maxIops , prometheus .GaugeValue , float64 (maxIops ), c .awsAccountID , c .awsRegion , dbidentifier )
608+ }
609+ if storageThroughput > 0 {
610+ ch <- prometheus .MustNewConstMetric (c .storageThroughput , prometheus .GaugeValue , storageThroughput , c .awsAccountID , c .awsRegion , dbidentifier )
611+ }
602612
603613 if c .configuration .CollectInstanceTags {
604614 names , values := c .getInstanceTagLabels (dbidentifier , instance )
0 commit comments