Skip to content
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 Checks module #76

Open
jongalloway opened this issue Feb 27, 2025 · 0 comments
Open

Health Checks module #76

jongalloway opened this issue Feb 27, 2025 · 0 comments

Comments

@jongalloway
Copy link
Contributor

Add a module for Health Checks.

  • Update the complete solution to include health checks.
  • Include /health and /alive checks on the Api
  • Add integration health checks such as database probe and redis cache, as well as the external service at https://api.weather.gov/
  • Explain how the WaitFor API uses health checks to determine if a resource is ready, and update the web application to wait for the API's health checks to indicate it is ready.
  • Include consideration for non-development environments, such as not exposing the endpoints externally or implementing request timeouts and output caching to prevent abuse or denial-of-service attacks.
  • Reference the content in the documentation at https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/health-checks and https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks
  • Include information at the end on the HealthChecksUI sample that explains it is possible to add the UI as a container and links to the sample for those who are interested.
  • Include a markdown file in the format of the other workshop markdown files. Write the code sections as instructions for students who will be making these updates in the application to get it to the state of the complete code.
jongalloway added a commit that referenced this issue Feb 27, 2025
Fixes #76

Add health checks module to the application.

* **Add Health Check Packages**: Add `Microsoft.Extensions.Diagnostics.HealthChecks`, `AspNetCore.HealthChecks.Npgsql`, and `AspNetCore.HealthChecks.Redis` package references to `complete/Api/Api.csproj`.
* **Add Health Check Services**: Add health check services for database, redis cache, and external service in `complete/Api/Program.cs`.
* **Add Health Check Endpoints**: Add health check endpoints for `/health` and `/alive` in `complete/Api/Program.cs`.
* **Considerations for Non-Development Environments**: Add considerations for non-development environments in `MapDefaultEndpoints` method in `complete/ServiceDefaults/Extensions.cs`.
* **Documentation**: Add `workshop/10-health-checks.md` to explain the health checks module and include instructions for students to update the application with health checks. Reference relevant documentation and include information on the HealthChecksUI sample.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/dotnet-presentations/dotnet-aspire-workshop/issues/76?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant