Skip to content

Commit

Permalink
AWS CloudWatch - properly parse multiple values of dimensionName & …
Browse files Browse the repository at this point in the history
…`dimensionValue` lists

Signed-off-by: Zbynek Roubalik <[email protected]>
  • Loading branch information
zroubalik committed Nov 6, 2024
1 parent 4eb7149 commit ca9d48d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Here is an overview of all new **experimental** features:
### Fixes

- **General**: Scalers cache uses a mutex to prevent concurrent actions ([#6273](https://github.com/kedacore/keda/issues/6273))
- **AWS CloudWatch Scaler**: Properly parse multiple values of `dimensionName` & `dimensionValue` lists ([#6236](https://github.com/kedacore/keda/issues/6236))
- **AWS Secret Manager**: Pod identity overrides are honored ([#6195](https://github.com/kedacore/keda/issues/6195))
- **AWS SQS Scaler**: Improve error handling for SQS queue metrics ([#6178](https://github.com/kedacore/keda/issues/6178))
- **Azure Event Hub Scaler**: Checkpointer errors are correctly handled ([#6084](https://github.com/kedacore/keda/issues/6084))
Expand Down
4 changes: 2 additions & 2 deletions pkg/scalers/aws_cloudwatch_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type awsCloudwatchMetadata struct {
triggerIndex int
Namespace string `keda:"name=namespace, order=triggerMetadata, optional"`
MetricsName string `keda:"name=metricName, order=triggerMetadata, optional"`
DimensionName []string `keda:"name=dimensionName, order=triggerMetadata, optional"`
DimensionValue []string `keda:"name=dimensionValue, order=triggerMetadata, optional"`
DimensionName []string `keda:"name=dimensionName, order=triggerMetadata, optional, separator=;"`
DimensionValue []string `keda:"name=dimensionValue, order=triggerMetadata, optional, separator=;"`
Expression string `keda:"name=expression, order=triggerMetadata, optional"`

TargetMetricValue float64 `keda:"name=targetMetricValue, order=triggerMetadata"`
Expand Down
16 changes: 16 additions & 0 deletions pkg/scalers/aws_cloudwatch_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,22 @@ var testAWSCloudwatchMetadata = []parseAWSCloudwatchMetadataTestData{
testAWSAuthentication, true,
"unsupported value for ignoreNullValues",
},
// test case for multiple dimensions with valid separator
{
map[string]string{
"namespace": "AWS/SQS",
"dimensionName": "QueueName;Region",
"dimensionValue": "queue1;us-west-2",
"metricName": "ApproximateNumberOfMessagesVisible",
"targetMetricValue": "5",
"minMetricValue": "1",
"metricStat": "Average",
"awsRegion": "us-west-2",
},
testAWSAuthentication,
false,
"Multiple dimensions with valid separator",
},
}

var awsCloudwatchMetricIdentifiers = []awsCloudwatchMetricIdentifier{
Expand Down

0 comments on commit ca9d48d

Please sign in to comment.