Skip to content

Commit ccdbe91

Browse files
authored
Upgraded Prometheus to further optimize ingester Push() on limits exceeded (#3973)
* Upgraded Prometheus Signed-off-by: Marco Pracucci <marco@pracucci.com> * Added PR number to CHANGELOG Signed-off-by: Marco Pracucci <marco@pracucci.com> * Upgrade Prometheus again Signed-off-by: Marco Pracucci <marco@pracucci.com>
1 parent c28d326 commit ccdbe91

File tree

22 files changed

+663
-56
lines changed

22 files changed

+663
-56
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* `cortex_ruler_clients`
1717
* `cortex_ruler_client_request_duration_seconds`
1818
* [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] 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
19+
* [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
2020
* [BUGFIX] Distributor: reverted changes done to rate limiting in #3825. #3948
2121
* [BUGFIX] Querier: streamline tracing spans. #3924
2222

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ require (
4747
github.com/prometheus/client_golang v1.9.0
4848
github.com/prometheus/client_model v0.2.0
4949
github.com/prometheus/common v0.18.0
50-
github.com/prometheus/prometheus v1.8.2-0.20210315220929-1cba1741828b
50+
github.com/prometheus/prometheus v1.8.2-0.20210319122004-e4f076f81302
5151
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
5252
github.com/sony/gobreaker v0.4.1
5353
github.com/spf13/afero v1.2.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,8 +1100,8 @@ github.com/prometheus/prometheus v1.8.2-0.20201029103703-63be30dceed9/go.mod h1:
11001100
github.com/prometheus/prometheus v1.8.2-0.20201119142752-3ad25a6dc3d9/go.mod h1:1MDE/bXgu4gqd5w/otko6WQpXZX9vu8QX4KbitCmaPg=
11011101
github.com/prometheus/prometheus v1.8.2-0.20201119181812-c8f810083d3f/go.mod h1:1MDE/bXgu4gqd5w/otko6WQpXZX9vu8QX4KbitCmaPg=
11021102
github.com/prometheus/prometheus v1.8.2-0.20210215121130-6f488061dfb4/go.mod h1:NAYujktP0dmSSpeV155mtnwX2pndLpVVK/Ps68R01TA=
1103-
github.com/prometheus/prometheus v1.8.2-0.20210315220929-1cba1741828b h1:TTOvmIV3W6IUIj3pYFs9gfCgueHlriLStMGBsnNdEX4=
1104-
github.com/prometheus/prometheus v1.8.2-0.20210315220929-1cba1741828b/go.mod h1:MS/bpdil77lPbfQeKk6OqVQ9OLnpN3Rszd0hka0EOWE=
1103+
github.com/prometheus/prometheus v1.8.2-0.20210319122004-e4f076f81302 h1:Cn4/28Finy29V4D+Exbo2l3NVsio8GrfyYZl80U2JCI=
1104+
github.com/prometheus/prometheus v1.8.2-0.20210319122004-e4f076f81302/go.mod h1:MS/bpdil77lPbfQeKk6OqVQ9OLnpN3Rszd0hka0EOWE=
11051105
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
11061106
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY=
11071107
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=

pkg/api/handlers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ func NewQuerierHandler(
189189
engine,
190190
errorTranslateQueryable{queryable}, // Translate errors to errors expected by API.
191191
nil, // No remote write support.
192+
nil, // No exemplars support.
192193
func(context.Context) v1.TargetRetriever { return &querier.DummyTargetRetriever{} },
193194
func(context.Context) v1.AlertmanagerRetriever { return &querier.DummyAlertmanagerRetriever{} },
194195
func() config.Config { return config.Config{} },

pkg/api/queryable_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ func createPrometheusAPI(q storage.SampleAndChunkQueryable) *route.Router {
136136
engine,
137137
q,
138138
nil,
139+
nil,
139140
func(context.Context) v1.TargetRetriever { return &querier.DummyTargetRetriever{} },
140141
func(context.Context) v1.AlertmanagerRetriever { return &querier.DummyAlertmanagerRetriever{} },
141142
func() config.Config { return config.Config{} },

pkg/ruler/compat.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ package ruler
22

33
import (
44
"context"
5+
"errors"
56
"time"
67

78
"github.com/go-kit/kit/log"
89
"github.com/prometheus/client_golang/prometheus"
910
"github.com/prometheus/prometheus/notifier"
11+
"github.com/prometheus/prometheus/pkg/exemplar"
1012
"github.com/prometheus/prometheus/pkg/labels"
1113
"github.com/prometheus/prometheus/pkg/value"
1214
"github.com/prometheus/prometheus/promql"
@@ -50,6 +52,10 @@ func (a *pusherAppender) Append(_ uint64, l labels.Labels, t int64, v float64) (
5052
return 0, nil
5153
}
5254

55+
func (a *pusherAppender) AppendExemplar(_ uint64, _ labels.Labels, _ exemplar.Exemplar) (uint64, error) {
56+
return 0, errors.New("exemplars are unsupported")
57+
}
58+
5359
func (a *pusherAppender) Commit() error {
5460
// Since a.pusher is distributor, client.ReuseSlice will be called in a.pusher.Push.
5561
// We shouldn't call client.ReuseSlice here.

vendor/github.com/prometheus/prometheus/pkg/exemplar/exemplar.go

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus/prometheus/promql/parser/ast.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus/prometheus/promql/test.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus/prometheus/rules/manager.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus/prometheus/rules/recording.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus/prometheus/scrape/scrape.go

Lines changed: 49 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/prometheus/prometheus/storage/fanout.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)