Skip to content

Commit

Permalink
fix: Default to fetching all metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbauerinc committed Dec 16, 2024
1 parent ad8a9e0 commit a577d51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion basic/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ var Metrics = []Metric{
cwName: "DatabaseConnections",
prometheusName: "aws_rds_database_connections",
prometheusHelp: "The number of database connections in use. Units: Count",
statistics: []string{"Sum", "Average"},
},
{
cwName: "Deadlocks",
Expand Down
4 changes: 2 additions & 2 deletions basic/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ func (s *Scraper) scrapeMetric(metric Metric) error {
now := time.Now()
end := now.Add(-Delay)

// If metric.statistics is empty, default to ["Average"] for backwards compatibility
// If metric.statistics is empty, default to all
stats := metric.statistics
if stats == nil || len(stats) == 0 {
stats = []string{"Average"}
stats = []string{"Average", "Sum", "Minimum", "Maximum"}
}

params := &cloudwatch.GetMetricStatisticsInput{
Expand Down

0 comments on commit a577d51

Please sign in to comment.