Skip to content

Commit

Permalink
fix rds error metric reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
jfchevrette committed Dec 6, 2019
1 parent 39c8ac3 commit e8efd47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,13 @@ func (e *RDSExporter) Collect(ch chan<- prometheus.Metric) {
*instance.DBParameterGroups[0].DBParameterGroupName,
val)
maxConnections = val
ch <- prometheus.MustNewConstMetric(e.MaxConnectionsMappingError, prometheus.GaugeValue, 0, *e.sess.Config.Region, *instance.DBInstanceIdentifier, *instance.DBInstanceClass)
} else {
log.Errorf("[RDS] No DB max_connections mapping exists for instance type %s parameter group %s",
*instance.DBInstanceClass,
*instance.DBParameterGroups[0].DBParameterGroupName)
ch <- prometheus.MustNewConstMetric(e.MaxConnectionsMappingError, prometheus.GaugeValue, 1, *e.sess.Config.Region, *instance.DBInstanceIdentifier, *instance.DBInstanceClass)
}
ch <- prometheus.MustNewConstMetric(e.MaxConnectionsMappingError, prometheus.GaugeValue, 0, *e.sess.Config.Region, *instance.DBInstanceIdentifier, *instance.DBInstanceClass)
} else {
log.Errorf("[RDS] No DB max_connections mapping exists for instance type %s",
*instance.DBInstanceClass)
Expand Down

0 comments on commit e8efd47

Please sign in to comment.