Commit e2adb4ce by Carl Bergquist Committed by GitHub

Merge pull request #12302 from grafana/12199_cloudwatch_panic

cloudwatch: handle invalid time range
parents 4be6ef4a c02dd746
......@@ -3,6 +3,7 @@ package cloudwatch
import (
"context"
"errors"
"fmt"
"regexp"
"sort"
"strconv"
......@@ -144,6 +145,10 @@ func (e *CloudWatchExecutor) executeQuery(ctx context.Context, parameters *simpl
return nil, err
}
if endTime.Before(startTime) {
return nil, fmt.Errorf("Invalid time range: End time can't be before start time")
}
params := &cloudwatch.GetMetricStatisticsInput{
Namespace: aws.String(query.Namespace),
MetricName: aws.String(query.MetricName),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment