CloudWatch: Logs queries should retry on throttling errors (#92535)

CloudWatch: logs queries should retry on throttling errors
This commit is contained in:
Isabella Siu
2024-08-30 13:55:00 -04:00
committed by GitHub
parent d6f871490e
commit 2d10068714
3 changed files with 67 additions and 1 deletions
+4
View File
@@ -25,6 +25,7 @@ import (
const (
limitExceededException = "LimitExceededException"
throttlingException = "ThrottlingException"
defaultEventLimit = int64(10)
defaultLogGroupLimit = int64(50)
logIdentifierInternal = "__log__grafana_internal__"
@@ -233,6 +234,9 @@ func (e *cloudWatchExecutor) executeStartQuery(ctx context.Context, logsClient c
if errors.As(err, &awsErr) && awsErr.Code() == "LimitExceededException" {
e.logger.FromContext(ctx).Debug("ExecuteStartQuery limit exceeded", "err", awsErr)
err = &AWSError{Code: limitExceededException, Message: err.Error()}
} else if errors.As(err, &awsErr) && awsErr.Code() == "ThrottlingException" {
e.logger.FromContext(ctx).Debug("ExecuteStartQuery rate exceeded", "err", awsErr)
err = &AWSError{Code: throttlingException, Message: err.Error()}
}
err = errorsource.DownstreamError(err, false)
}