dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.94k stars 483 forks source link

Allow Health Check intervals to be configurable #6112

Open afscrome opened 1 month ago

afscrome commented 1 month ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

The Health Checks used as part of wait for currently run every 5 seconds. If you have a long chain of WaitFor dependencies, these delays can add up to significant amounts of times waiting for no real reason.

I get why a 5 second interval may be wanted in production to avoid generating too much load, but in local dev I don't care about the overhead of running extra health checks and would much rather run them more frequently - I'm tempted to even drop them as low as 100ms.

Describe the solution you'd like

I'd like to see configuration options to tune the 5 and 30 second health check intervals made into configuration options https://github.com/dotnet/aspire/blob/cd1f9fd4e5427a1dfcd0bc1eacbd699acdd22874/src/Aspire.Hosting/Health/ResourceHealthCheckService.cs#L64 and https://github.com/dotnet/aspire/blob/cd1f9fd4e5427a1dfcd0bc1eacbd699acdd22874/src/Aspire.Hosting/Health/ResourceHealthCheckService.cs#L116

Or if we can detect local dev vs published applications, perhaps we could pick some more aggressive defaults for local dev, whilst keeping the safer defaults for published applications.

Additional context

No response

davidfowl commented 1 month ago

I’m not sure this needs to be configurable. We can make the check more aggressive while unhealthy.

cc @mitchdenny