mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Merge pull request #86521 from jfbai/exclude-system-previledged-group-requests-from-dropped-requests
Count dropped requests except system previledged group requests.
This commit is contained in:
commit
a1364be012
@ -160,14 +160,6 @@ func WithMaxInFlightLimit(
|
|||||||
handler.ServeHTTP(w, r)
|
handler.ServeHTTP(w, r)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// We need to split this data between buckets used for throttling.
|
|
||||||
if isMutatingRequest {
|
|
||||||
metrics.DroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
|
|
||||||
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
|
|
||||||
} else {
|
|
||||||
metrics.DroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
|
|
||||||
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
|
|
||||||
}
|
|
||||||
// at this point we're about to return a 429, BUT not all actors should be rate limited. A system:master is so powerful
|
// at this point we're about to return a 429, BUT not all actors should be rate limited. A system:master is so powerful
|
||||||
// that they should always get an answer. It's a super-admin or a loopback connection.
|
// that they should always get an answer. It's a super-admin or a loopback connection.
|
||||||
if currUser, ok := apirequest.UserFrom(ctx); ok {
|
if currUser, ok := apirequest.UserFrom(ctx); ok {
|
||||||
@ -178,6 +170,14 @@ func WithMaxInFlightLimit(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// We need to split this data between buckets used for throttling.
|
||||||
|
if isMutatingRequest {
|
||||||
|
metrics.DroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
|
||||||
|
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
|
||||||
|
} else {
|
||||||
|
metrics.DroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
|
||||||
|
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
|
||||||
|
}
|
||||||
metrics.RecordRequestTermination(r, requestInfo, metrics.APIServerComponent, http.StatusTooManyRequests)
|
metrics.RecordRequestTermination(r, requestInfo, metrics.APIServerComponent, http.StatusTooManyRequests)
|
||||||
tooManyRequests(r, w)
|
tooManyRequests(r, w)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user