Pieter Marsman
06/10/2024, 7:03 PMrequests_in_progress gauge, and use it to create a custom endpoint that fails when the value is above some threshold. I could not find a way to get that gauge because it is implemented in the middleware. Also any custom endpoint will have the POST method, and a liveness probe needs the GET method.
Would love to have some suggestions on how to do this. Using BentoCloud is definitely on our roadmap, but not for now.Pieter Marsman
06/11/2024, 7:12 AMMaxConcurrencyMiddleware has a class variable that excludes /livez from the concurrency checks. By removing that, the /livez now also fails when the service is already handling the max concurrent requests.
from bentoml._internal.server.http.traffic import MaxConcurrencyMiddleware
MaxConcurrencyMiddleware.BYPASS_PATHS = frozenset({"/metrics", "/healthz", "/readyz"}) # no /livez herePieter Marsman
06/11/2024, 7:30 AMPieter Marsman
06/13/2024, 12:14 PM