dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.64k stars 411 forks source link

Resource health check polling (cloud traffic concerns) #5602

Open mitchdenny opened 1 week ago

mitchdenny commented 1 week ago

In #5601 we reduce the period for health check execution. We go from 30 seconds to 5 seconds. Some cloud hosted resources could be more expensive for health check intervals.

Do we need to introduce a Period property on the HealthCheckAnnotation and then improve the logic in ResourceHealthCheckScheduler to enable or disable a check based on whether the per resource internal has been reached. We might want to have two intervals, one for startup and one for normal running with the AddXYZResource method able to set the sensible default.

This would make the scheduler more complex.

mitchdenny commented 1 week ago

/cc @davidfowl