You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Small optimization to PrometheusResponse marshalling (#3964)
* Small optimization to PrometheusResponse marshalling
Signed-off-by: Marco Pracucci <[email protected]>
* Fixed TestResponse
Signed-off-by: Marco Pracucci <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@
16
16
*`cortex_ruler_clients`
17
17
*`cortex_ruler_client_request_duration_seconds`
18
18
*[ENHANCEMENT] Query-frontend/scheduler: added querier forget delay (`-query-frontend.querier-forget-delay` and `-query-scheduler.querier-forget-delay`) to mitigate the blast radius in the event queriers crash because of a repeatedly sent "query of death" when shuffle-sharding is enabled. #3901
19
+
*[ENHANCEMENT] Query-frontend: reduced memory allocations when serializing query response. #3964
19
20
*[ENHANCEMENT] Ingester: reduce CPU and memory when an high number of errors are returned by the ingester on the write path with the blocks storage. #3969#3971#3973
20
21
*[BUGFIX] Distributor: reverted changes done to rate limiting in #3825. #3948
21
22
*[BUGFIX] Ingester: Fix race condition when opening and closing tsdb concurrently. #3959
Copy file name to clipboardExpand all lines: pkg/querier/queryrange/query_range.go
+17-8
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,12 @@ import (
31
31
constStatusSuccess="success"
32
32
33
33
var (
34
-
matrix=model.ValMatrix.String()
35
-
json=jsoniter.ConfigCompatibleWithStandardLibrary
34
+
matrix=model.ValMatrix.String()
35
+
json= jsoniter.Config{
36
+
EscapeHTML: false, // No HTML in our responses.
37
+
SortMapKeys: true,
38
+
ValidateJsonRawMessage: true,
39
+
}.Froze()
36
40
errEndBeforeStart=httpgrpc.Errorf(http.StatusBadRequest, "end timestamp must not be before start time")
37
41
errNegativeStep=httpgrpc.Errorf(http.StatusBadRequest, "zero or negative query resolution step widths are not accepted. Try a positive integer")
38
42
errStepTooSmall=httpgrpc.Errorf(http.StatusBadRequest, "exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)")
@@ -262,16 +266,20 @@ func (prometheusCodec) DecodeResponse(ctx context.Context, r *http.Response, _ R
0 commit comments