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

Difference between UseHealthChecks and MapHealthChecks #29421

Closed
ngbrown opened this issue Jun 3, 2023 · 1 comment · Fixed by #29439
Closed

Difference between UseHealthChecks and MapHealthChecks #29421

ngbrown opened this issue Jun 3, 2023 · 1 comment · Fixed by #29439
Assignees
Labels
doc-idea seQUESTered Identifies that an issue has been imported into Quest. Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@ngbrown
Copy link
Contributor

ngbrown commented Jun 3, 2023

This Health checks in ASP.NET Core page doesn't mention UseHealthChecks at all, and the few places in this repository that contain it, don't explain the difference between UseHealthChecks and MapHealthChecks very well. The 2.2 to 3.0 migration page mentions benefits of authentication, but that wouldn't apply to the Kubernetes use that this page is using as an example.

Because this page mentions Kubernetes readiness and liveness probe, and these endpoints are called a lot, I think this distinction would especially helpful. I've seen it mention that one might want to use one vs. the other when using logging middleware of requests.

I view one of the advantages of UseHealthChecks is that it will terminate the pipeline if the path matches so it can be placed before the logging middleware and the logs will be skipped.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 97769

@dotnet-bot dotnet-bot added ⌚ Not Triaged Source - Docs.ms Docs Customer feedback via GitHub Issue labels Jun 3, 2023
@Rick-Anderson Rick-Anderson self-assigned this Jun 6, 2023
@Rick-Anderson Rick-Anderson added the reQUEST Triggers an issue to be imported into Quest label Jun 6, 2023
@github-actions github-actions bot added seQUESTered Identifies that an issue has been imported into Quest. and removed reQUEST Triggers an issue to be imported into Quest labels Jun 6, 2023
@cremor
Copy link

cremor commented Jun 7, 2023

I view one of the advantages of UseHealthChecks is that it will terminate the pipeline if the path matches so it can be placed before the logging middleware and the logs will be skipped.

I agree. But the difference is confusing. See #29439 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-idea seQUESTered Identifies that an issue has been imported into Quest. Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants