-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Health check #670
Health check #670
Conversation
…structor (dapr#621) * Fixes bug of constructor argument being used as http endpoint Signed-off-by: Elena Kolevska <elena@kolevska.com> * Updates tests Signed-off-by: Elena Kolevska <elena@kolevska.com> * Updates the docs explaining how http service invocation should be configured Signed-off-by: Elena Kolevska <elena@kolevska.com> * Update daprdocs/content/en/python-sdk-docs/python-client.md Signed-off-by: Bernd Verst <github@bernd.dev> --------- Signed-off-by: Elena Kolevska <elena@kolevska.com> Signed-off-by: Bernd Verst <github@bernd.dev> Co-authored-by: Bernd Verst <github@bernd.dev> Signed-off-by: Elena Kolevska <elena@kolevska.com> # Conflicts: # dapr/clients/__init__.py # dapr/clients/http/client.py # dapr/clients/http/dapr_invocation_http_client.py # tests/clients/test_http_service_invocation_client.py # tests/clients/test_secure_http_service_invocation_client.py
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #670 +/- ##
==========================================
- Coverage 86.37% 86.18% -0.19%
==========================================
Files 79 82 +3
Lines 4094 4170 +76
==========================================
+ Hits 3536 3594 +58
- Misses 558 576 +18 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com> # Conflicts: # dapr/clients/http/client.py # tests/clients/test_http_service_invocation_client.py
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com> # Conflicts: # tests/clients/test_dapr_async_grpc_client.py
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
@@ -98,7 +98,7 @@ class ActorProxy: | |||
communication. | |||
""" | |||
|
|||
_default_proxy_factory = ActorProxyFactory() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this to the instance creation because it was getting invoked on import(dependency load), which was triggering the healthcheck before the fake test servers would start.
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
self._fake_dapr_server = FakeDaprSidecar() | ||
self._fake_dapr_server.start(self.server_port) | ||
@classmethod | ||
def setUpClass(cls): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the server creation in all tests to the setUpClass
method. With this, we got a speed improvement of around 300% (from ~6m to ~1.45m).
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Description
This PR adds a health check against Dapr's health endpoint instead of checking if the socket is open.
The check is added on all the clients' init methods (grpc, http, async grpc, actor and invocation).
The timeout can be configured through the
DAPR_HEALTH_TIMEOUT
environment variable.The default value for
DAPR_HEALTH_TIMEOUT
is 60 seconds.Issue reference
#611
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
Release notes
When connecting to a remote sidecar,
DAPR_HTTP_ENDPOINT
needs to be set, even when only gRPC is used, because the health endpoint is http-only.