소스 검색

Update time_series_query.go

fix alert no data when elasticsearch group by terms size is set to no limit
Yuan Liu 7 년 전
부모
커밋
3b9ab6e204
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      pkg/tsdb/elasticsearch/time_series_query.go

+ 4 - 0
pkg/tsdb/elasticsearch/time_series_query.go

@@ -171,6 +171,10 @@ func addTermsAgg(aggBuilder es.AggBuilder, bucketAgg *BucketAgg, metrics []*Metr
 		} else {
 			a.Size = 500
 		}
+		if a.Size == 0 {
+		    a.Size = 500
+		}
+		
 		if minDocCount, err := bucketAgg.Settings.Get("min_doc_count").Int(); err == nil {
 			a.MinDocCount = &minDocCount
 		}