diff --git a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx
index 724462840e7..5ad6019fc2b 100644
--- a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx
+++ b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx
@@ -191,4 +191,14 @@ describe('MetricStatEditor', () => {
]);
});
});
+
+ describe('metric value', () => {
+ it('should be displayed when a custom value is used and its value is not in the select options', async () => {
+ const expected = 'CPUUtilzation';
+ await act(async () => {
+ render();
+ });
+ expect(await screen.findByText(expected)).toBeInTheDocument();
+ });
+ });
});
diff --git a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx
index 16a49cb0f14..0520f7d600c 100644
--- a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx
+++ b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx
@@ -61,7 +61,7 @@ export function MetricStatEditor({