Skip to content

Commit c5dccb5

Browse files
authored
Merge pull request #169 from lexx-bright/master
Promethues querier. Constrain maximum timestamp.
2 parents f601b82 + 81238f8 commit c5dccb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

prometheus/querier_select.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !noprom
12
// +build !noprom
23

34
package prometheus
@@ -43,7 +44,8 @@ func (q *Querier) Select(selectParams *storage.SelectParams, labelsMatcher ...*l
4344
if from.IsZero() && q.mint > 0 {
4445
from = time.Unix(q.mint/1000, (q.mint%1000)*1000000)
4546
}
46-
if until.IsZero() && q.maxt > 0 {
47+
// ClickHouse supported Datetime range of values: [1970-01-01 00:00:00, 2105-12-31 23:59:59]
48+
if until.IsZero() && q.maxt > 0 && q.maxt <= 4291765199000 {
4749
until = time.Unix(q.maxt/1000, (q.maxt%1000)*1000000)
4850
}
4951

0 commit comments

Comments
 (0)