From 7b30fae36fa00a66fcd2b881f84fddbe261987ef Mon Sep 17 00:00:00 2001 From: Andres Martinez Gotor Date: Fri, 1 Apr 2022 06:49:09 -0700 Subject: [PATCH] Cloudwatch: Improve alerting related docs (#47178) --- docs/sources/datasources/aws-cloudwatch/_index.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/sources/datasources/aws-cloudwatch/_index.md b/docs/sources/datasources/aws-cloudwatch/_index.md index 22833348ea2..f86572dc142 100644 --- a/docs/sources/datasources/aws-cloudwatch/_index.md +++ b/docs/sources/datasources/aws-cloudwatch/_index.md @@ -323,7 +323,16 @@ If you're not currently logged in to the CloudWatch console, the link will forwa ## Alerting -Since CloudWatch Logs queries can return numeric data, for example through the use of the `stats` command, alerts are supported. +Alerting require queries that return numeric data, which CloudWatch Logs support. For example through the use of the `stats` command, alerts are supported. For example, this is a valid query for alerting on messages that include the text "Exception": + +``` +filter @message like /Exception/ + | stats count(*) as exceptionCount by bin(1h) + | sort exceptionCount desc +``` + +**NOTE**: When trying to alert on a query, if an error like `input data must be a wide series but got ...` is received, make sure that your query returns valid numeric data that can be printed in a Time series panel. + For more information on Grafana alerts, refer to [Alerting]({{< relref "../../alerting/_index.md" >}}) documentation. ## Configure CloudWatch with grafana.ini