-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding circuit breakers on ingester server side for read path #8285
Conversation
d1c5604
to
ea700ee
Compare
Can we use a middleware instead of having to explicitly call this in each method of the server? I see that push requests are limited through a call from |
grpc middleware may be a better place here. |
2fbcce4
to
8d5cac9
Compare
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
bfac281
to
57561d5
Compare
From our internal Slack discussion: Peter: If I understand it correctly … if read requests are taking longer than 30s, this can trigger opening of CB, and ingester will start rejecting push requests? Oleg: Yeah, those should be two separate circuit breaker instances. The read one should try to acquire both read & write, but the write should only take the write one. |
What this PR does
In #8180 we added circuit breakers on ingester server side for write path. This PR extends the feature by implementing the read path counter part.
Circuit breakers on ingester read path behave like this: before any of the read path-related methods (
ingester.QueryStream()
,ingestser.QueryExemplars()
,ingester.LabelValues()
,ingester.LabelNames()
,ingester.UserStats()
,ingester.AllUserStats()
,ingester.MetricsForLabelMatchers()
,ingester.MetricsMetadata()
,ingester.LabelNamesAndValues()
,ingester.LabelValuesCardinality()
,ingester.ActiveSeries()
) is executed, we try to acquire a circuit breaker permit. If a permit is not acquired due to an open circuit breaker, the request is rejected. If a permit is acquired, a read request is started. Once the read request is completed, the result is recorded with the circuit breaker: if the read request ended with a circuit breaker relevant error, a failure is recorded with the circuit breaker. Otherwise, a success is recorded. Errors which are relevant for ingester server side circuit breakers are per-instance limits and timeouts. Timeouts on the read path can occur if a read request lasts longer than the configured maximal duration of read requests.Circuit breakers can be activated by setting
-ingester.circuit-breaker.enabled
totrue
. Maximal duration of read requests can be configured as-ingester.circuit-breaker.read-timeout
.Which issue(s) this PR fixes or relates to
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.