dotnet / dotnet/aspnetcore

Health Checks - Register path/options with dependency injection

Open
#18,153 2 comments 16 reactions 0 assignees View on GitHub
affected-very-few area-healthchecks enhancement severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is your feature request related to a problem? Please describe.
This feature would directly support development efforts on:
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1058

When adding health checks using `IApplicationBuilder.UseHealthChecks`, the values of path and `HealthCheckOptions` are only used to map `HealthCheckMiddleware`. After the middleware is registered, there is no way to retrieve this information at runtime.

### Describe the solution you'd like
To have [HealthCheckApplicationBuilderExtensions.cs](https://github.com/aspnet/AspNetCore/blob/master/src/Middleware/HealthChecks/src/Builder/HealthCheckApplicationBuilderExtensions.cs) refactored in a non-breaking way so that the path and `HealthCheckOptions` information is accessible at runtime (preferably via dependency injection).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.