CloudWatch: Deprecate dynamic labels feature toggle, remove support for Alias in backend (#66494)

This commit is contained in:
Shirley
2023-04-27 11:19:45 +02:00
committed by GitHub
parent 69a14b9a5e
commit e17496d79a
14 changed files with 162 additions and 411 deletions
@@ -20,17 +20,14 @@ func TestMetricDataInputBuilder(t *testing.T) {
name string
timezoneUTCOffset string
expectedLabelOptions *cloudwatch.LabelOptions
featureEnabled bool
}{
{name: "when timezoneUTCOffset is provided and feature is enabled", timezoneUTCOffset: "+1234", expectedLabelOptions: &cloudwatch.LabelOptions{Timezone: aws.String("+1234")}, featureEnabled: true},
{name: "when timezoneUTCOffset is not provided and feature is enabled", timezoneUTCOffset: "", expectedLabelOptions: nil, featureEnabled: true},
{name: "when timezoneUTCOffset is provided and feature is disabled", timezoneUTCOffset: "+1234", expectedLabelOptions: nil, featureEnabled: false},
{name: "when timezoneUTCOffset is not provided and feature is disabled", timezoneUTCOffset: "", expectedLabelOptions: nil, featureEnabled: false},
{name: "when timezoneUTCOffset is provided", timezoneUTCOffset: "+1234", expectedLabelOptions: &cloudwatch.LabelOptions{Timezone: aws.String("+1234")}},
{name: "when timezoneUTCOffset is not provided", timezoneUTCOffset: "", expectedLabelOptions: nil},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
executor := newExecutor(nil, newTestConfig(), &fakeSessionCache{}, featuremgmt.WithFeatures(featuremgmt.FlagCloudWatchDynamicLabels, tc.featureEnabled))
executor := newExecutor(nil, newTestConfig(), &fakeSessionCache{}, featuremgmt.WithFeatures())
query := getBaseQuery()
query.TimezoneUTCOffset = tc.timezoneUTCOffset