Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
* [BUGFIX] Memberlist: Add join with no retrying when starting service. #4804
* [BUGFIX] Ruler: Fix /ruler/rule_groups returns YAML with extra fields. #4767
* [BUGFIX] Respecting `-tracing.otel.sample-ratio` configuration when enabling OpenTelemetry tracing with X-ray. #4862
* [BUGFIX] QueryFrontend: fixed query_range requests when query has `start` equals to `end`. #4877

## 1.13.0 2022-07-14

Expand Down
5 changes: 5 additions & 0 deletions pkg/querier/tripperware/queryrange/split_by_interval.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ func (s splitByInterval) Do(ctx context.Context, r tripperware.Request) (tripper
}

func splitQuery(r tripperware.Request, interval time.Duration) ([]tripperware.Request, error) {
// If Start == end we should just run the original request
if r.GetStart() == r.GetEnd() {
return []tripperware.Request{r}, nil
}

// Replace @ modifier function to their respective constant values in the query.
// This way subqueries will be evaluated at the same time as the parent query.
query, err := evaluateAtModifierFunction(r.GetQuery(), r.GetStart(), r.GetEnd())
Expand Down
17 changes: 17 additions & 0 deletions pkg/querier/tripperware/queryrange/split_by_interval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ func TestSplitQuery(t *testing.T) {
},
interval: day,
},
{
input: &PrometheusRequest{
Start: 60 * 60 * seconds,
End: 60 * 60 * seconds,
Step: 15 * seconds,
Query: "foo",
},
expected: []tripperware.Request{
&PrometheusRequest{
Start: 60 * 60 * seconds,
End: 60 * 60 * seconds,
Step: 15 * seconds,
Query: "foo",
},
},
interval: day,
},
{
input: &PrometheusRequest{
Start: 0,
Expand Down