-
Notifications
You must be signed in to change notification settings - Fork 543
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
WaitFor integration with Health Check Service #5515
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidfowl
reviewed
Sep 2, 2024
davidfowl
reviewed
Sep 2, 2024
davidfowl
reviewed
Sep 2, 2024
davidfowl
reviewed
Sep 2, 2024
src/Aspire.Hosting/Health/ResourceNotificationHealthCheckPublisher.cs
Outdated
Show resolved
Hide resolved
davidfowl
reviewed
Sep 2, 2024
… and AzureProvisioner.
mitchdenny
commented
Sep 4, 2024
src/Aspire.Hosting.Azure/Provisioning/Provisioners/AzureProvisioner.cs
Outdated
Show resolved
Hide resolved
mitchdenny
commented
Sep 4, 2024
mitchdenny
commented
Sep 4, 2024
mitchdenny
commented
Sep 4, 2024
mitchdenny
commented
Sep 4, 2024
davidfowl
reviewed
Sep 5, 2024
This needs tests |
Yes it does! I didn't think you'd like me #YOLO merge this one. |
davidfowl
reviewed
Sep 5, 2024
4 tasks
davidfowl
reviewed
Sep 6, 2024
Co-authored-by: David Fowler <davidfowl@gmail.com>
…m/dotnet/aspire into mitchdenny/healthcheckintegration
This was referenced Sep 6, 2024
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
davidfowl
approved these changes
Sep 6, 2024
15 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR integrates
WaitFor
with health checks from the .NET hosting model. Extension methods likeAddRedis(...)
register a health check in DI which uses the connection string which is produced when the resource is provisioned.A new annotation
HealthCheckAnnotation
keeps track of the health check names associated with each resource and a health check publisher implementationResourceNotificationHealthCheckPublisher
transcribes health check status from the health check report to a new property on the ResourceEvent (HealthStatus
).In
WaitFor
we determine whether a resources's dependencies has aHealthCheckAnnotation
and if it does it waits for the health status to return healthy.This PR also introduces a new event ....
ConnectionStringAvailableEvent
which is used byAddRedis(...)
andAddPostgres(...)
to detect when the connection string is available so we can store it in a captured string which is used by the health check. This is significant because it allows Azure hosted resources to participate in the health-check enabledWaitFor(...)
experience.In the case of DCP hosted resource sthe
ConnectionStringAvailableEvent
is fired at the same time asBeforeResourceStartedEvent
- but in the case of the AzureProvisioner it is fired after the resource is online in Azure (so the order is roughly opposite) - hence why we needed another event (Azure hosted resources don't get endpoint allocated events).Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow