Skip to content

Commit b13e224

Browse files
committed
Count dropped requests except system previledged group requests.
1 parent 42fe74c commit b13e224

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

staging/src/k8s.io/apiserver/pkg/server/filters/maxinflight.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,6 @@ func WithMaxInFlightLimit(
160160
handler.ServeHTTP(w, r)
161161

162162
default:
163-
// We need to split this data between buckets used for throttling.
164-
if isMutatingRequest {
165-
metrics.DroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
166-
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
167-
} else {
168-
metrics.DroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
169-
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
170-
}
171163
// at this point we're about to return a 429, BUT not all actors should be rate limited. A system:master is so powerful
172164
// that they should always get an answer. It's a super-admin or a loopback connection.
173165
if currUser, ok := apirequest.UserFrom(ctx); ok {
@@ -178,6 +170,14 @@ func WithMaxInFlightLimit(
178170
}
179171
}
180172
}
173+
// We need to split this data between buckets used for throttling.
174+
if isMutatingRequest {
175+
metrics.DroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
176+
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.MutatingKind).Inc()
177+
} else {
178+
metrics.DroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
179+
metrics.DeprecatedDroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc()
180+
}
181181
metrics.RecordRequestTermination(r, requestInfo, metrics.APIServerComponent, http.StatusTooManyRequests)
182182
tooManyRequests(r, w)
183183
}

0 commit comments

Comments
 (0)