|
|
@@ -126,6 +126,18 @@ func (e *CloudWatchExecutor) executeTimeSeriesQuery(ctx context.Context, queryCo
|
|
|
}
|
|
|
|
|
|
eg.Go(func() error {
|
|
|
+ defer func() {
|
|
|
+ if err := recover(); err != nil {
|
|
|
+ plog.Error("Execute Query Panic", "error", err, "stack", log.Stack(1))
|
|
|
+ if theErr, ok := err.(error); ok {
|
|
|
+ resultChan <- &tsdb.QueryResult{
|
|
|
+ RefId: query.RefId,
|
|
|
+ Error: theErr,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
queryRes, err := e.executeQuery(ectx, query, queryContext)
|
|
|
if ae, ok := err.(awserr.Error); ok && ae.Code() == "500" {
|
|
|
return err
|
|
|
@@ -146,6 +158,17 @@ func (e *CloudWatchExecutor) executeTimeSeriesQuery(ctx context.Context, queryCo
|
|
|
for region, getMetricDataQuery := range getMetricDataQueries {
|
|
|
q := getMetricDataQuery
|
|
|
eg.Go(func() error {
|
|
|
+ defer func() {
|
|
|
+ if err := recover(); err != nil {
|
|
|
+ plog.Error("Execute Get Metric Data Query Panic", "error", err, "stack", log.Stack(1))
|
|
|
+ if theErr, ok := err.(error); ok {
|
|
|
+ resultChan <- &tsdb.QueryResult{
|
|
|
+ Error: theErr,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
queryResponses, err := e.executeGetMetricDataQuery(ectx, region, q, queryContext)
|
|
|
if ae, ok := err.(awserr.Error); ok && ae.Code() == "500" {
|
|
|
return err
|
|
|
@@ -188,8 +211,8 @@ func (e *CloudWatchExecutor) executeQuery(ctx context.Context, query *CloudWatch
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- if endTime.Before(startTime) {
|
|
|
- return nil, fmt.Errorf("Invalid time range: End time can't be before start time")
|
|
|
+ if !startTime.Before(endTime) {
|
|
|
+ return nil, fmt.Errorf("Invalid time range: Start time must be before end time")
|
|
|
}
|
|
|
|
|
|
params := &cloudwatch.GetMetricStatisticsInput{
|