From a577d51324d3658d2da3a284461ae1457f5ac1db Mon Sep 17 00:00:00 2001 From: Michael Bauer Date: Mon, 16 Dec 2024 12:21:06 -0500 Subject: [PATCH] fix: Default to fetching all metrics --- basic/metrics.go | 1 - basic/scraper.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/basic/metrics.go b/basic/metrics.go index 89beab8f..7aecf19d 100644 --- a/basic/metrics.go +++ b/basic/metrics.go @@ -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", diff --git a/basic/scraper.go b/basic/scraper.go index 0a25219f..2f905bd9 100644 --- a/basic/scraper.go +++ b/basic/scraper.go @@ -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{