Closed evhen14 closed 2 months ago
Please run tox -e ruff
for our autoformatter of source files.
@berndverst tox -e ruff
was applied. Thx for your feedback!
ext/dapr-ext-grpc/dapr/ext/grpc/_health_servicer.py:17: error: Function "cb" could always be true in boolean context [truthy-function]
ext/dapr-ext-grpc/dapr/ext/grpc/_health_servicer.py:22: error: Attribute "_health_check_cb" already defined on line 19 [no-redef]
ext/dapr-ext-grpc/dapr/ext/grpc/_health_servicer.py:22: error: Incompatible types in assignment (expression has type "None", variable has type "Callable[[], None]") [assignment]
Attention: Patch coverage is 97.26027%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 86.22%. Comparing base (
fc0e9d1
) to head (eed11ed
). Report is 25 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
...xt/dapr-ext-grpc/dapr/ext/grpc/_health_servicer.py | 94.73% | 1 Missing :warning: |
ext/dapr-ext-grpc/tests/test_app.py | 88.88% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@holopin-bot @evhen14 Thank you!
Congratulations @evhen14, the maintainer of this repository has issued you a badge! Here it is: https://holopin.io/claim/clzvb5nb524130djsaga7l99m
This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!
Description
Add health check support to the SDK for gRPC following the example of the go-sdk. The dapr docs state that the
/dapr.proto.runtime.v1.AppCallbackHealthCheck/HealthCheck
endpoint is called, but this SDK doesn't support specifying that method implementation.The suggested way to use it would be
app.register_health_check(health_check_func)
Use case 1: gRPC endpoints depend on other components to function properly. The health checks callback can be used to validate the liveness of the other components
Use case 2: Run gRPC app next to a web app in the same container in a separate thread. The entire app is healthy only when both dapr app and web app are healthy. I expect that dapr thread could die or stop being responsive, hence the way to add health checks.
Issue reference
It's the outcome of the issue #722 I raised earlier where I see a gap for adding meaningful health checks
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: