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
In an ideal state, I'd like to see controller_runtime_webhook_requests_total metric actually let me understand things like how many requests I'm denying (non-200 codes, such as 403, 400, 429, ...).
/kind bug
The text was updated successfully, but these errors were encountered:
I believe the 200 response is if the webhook can create the response. There was an issue around this with failure policy and not sure if this helps with your issue #2662.
Pretty much what troy said. I do agree that this is confusing and that it would be helpful to have metrics around the status code in the admission response.
Indeed, after creating the issue I've realized HTTP response code must be 200 regardless of the admission response (which contains the status code the apiserver would return in its response body).
Maybe we could still add a metric that parses the code out from admission.Response? (I understand we can't help if someone actually decides to implement their own http.Handler).
This is several bugs in one bug since it appears multiple things are broken. Apologies if it gets too complicated.
Problem 1: It appears that controller-runtime webhooks always respond with HTTP status code
200 OK
even if the request is completely malformed.Example (sending a malformed request to a webhook endpoint):
Problem 2: controller-runtime webhooks do not use the
metav1.Status.Code
and always respond with HTTP status code200 OK
.Example code I used to register my custom handler at
/test
:And here's the query I am making:
Problem 3: controller-runtime doesn't expose any metrics about rejected requests and their
.status.code
s. This is likely becausecontroller_runtime_webhook_requests_total{code=...}
dimension to only200
and500
here:controller-runtime/pkg/webhook/internal/metrics/metrics.go
Lines 70 to 76 in 4cae9df
so even if I make a faulty request, only the code=200 metric goes up:
In an ideal state, I'd like to see
controller_runtime_webhook_requests_total
metric actually let me understand things like how many requests I'm denying (non-200 codes, such as 403, 400, 429, ...)./kind bug
The text was updated successfully, but these errors were encountered: