mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	cloudwatch: handle invalid time range
This commit is contained in:
		@@ -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),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user