From dc4f063634d3a752d7acc079d7d39fe052925d17 Mon Sep 17 00:00:00 2001 From: chesleypappas Date: Wed, 30 Oct 2024 09:57:46 -0400 Subject: [PATCH] fix(cloudwatch): use correct metric statistic for IncomingLogEvents (#589) Fixes #588 --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_ Co-authored-by: Chesley Pappas --- .../CloudWatchLogsMetricFactory.ts | 2 +- .../__snapshots__/LogMonitoring.test.ts.snap | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/monitoring/aws-cloudwatch/CloudWatchLogsMetricFactory.ts b/lib/monitoring/aws-cloudwatch/CloudWatchLogsMetricFactory.ts index 2a141a7e..819ff583 100644 --- a/lib/monitoring/aws-cloudwatch/CloudWatchLogsMetricFactory.ts +++ b/lib/monitoring/aws-cloudwatch/CloudWatchLogsMetricFactory.ts @@ -34,7 +34,7 @@ export class CloudWatchLogsMetricFactory extends BaseMetricFactory 9001 for 3 datapoints within 15 minutes\\",\\"value\\":9001,\\"yAxis\\":\\"left\\"}]},\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", + "\\",\\"metrics\\":[[\\"AWS/Logs\\",\\"IncomingLogEvents\\",\\"LogGroupName\\",\\"DummyLogGroup\\",{\\"label\\":\\"Logs\\",\\"stat\\":\\"Sum\\"}]],\\"annotations\\":{\\"horizontal\\":[{\\"label\\":\\"Logs < 20 for 3 datapoints within 15 minutes\\",\\"value\\":20,\\"yAxis\\":\\"left\\"},{\\"label\\":\\"Logs > 9001 for 3 datapoints within 15 minutes\\",\\"value\\":9001,\\"yAxis\\":\\"left\\"}]},\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", ], ], }, @@ -341,7 +341,7 @@ Object { "Namespace": "AWS/Logs", }, "Period": 300, - "Stat": "SampleCount", + "Stat": "Sum", }, "ReturnData": true, }, @@ -375,7 +375,7 @@ Object { "Namespace": "AWS/Logs", }, "Period": 300, - "Stat": "SampleCount", + "Stat": "Sum", }, "ReturnData": true, }, @@ -395,7 +395,7 @@ Object { Object { "Ref": "AWS::Region", }, - "\\",\\"metrics\\":[[\\"AWS/Logs\\",\\"IncomingLogEvents\\",\\"LogGroupName\\",\\"DummyLogGroup\\",{\\"label\\":\\"Logs\\",\\"stat\\":\\"SampleCount\\"}]],\\"annotations\\":{\\"horizontal\\":[{\\"label\\":\\"Logs < 20 for 3 datapoints within 15 minutes\\",\\"value\\":20,\\"yAxis\\":\\"left\\"},{\\"label\\":\\"Logs > 9001 for 3 datapoints within 15 minutes\\",\\"value\\":9001,\\"yAxis\\":\\"left\\"}]},\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", + "\\",\\"metrics\\":[[\\"AWS/Logs\\",\\"IncomingLogEvents\\",\\"LogGroupName\\",\\"DummyLogGroup\\",{\\"label\\":\\"Logs\\",\\"stat\\":\\"Sum\\"}]],\\"annotations\\":{\\"horizontal\\":[{\\"label\\":\\"Logs < 20 for 3 datapoints within 15 minutes\\",\\"value\\":20,\\"yAxis\\":\\"left\\"},{\\"label\\":\\"Logs > 9001 for 3 datapoints within 15 minutes\\",\\"value\\":9001,\\"yAxis\\":\\"left\\"}]},\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", ], ], },