AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

Would be useful if UIResponseWriter had more extensibility

Open terjew opened this issue 1 year ago • 0 comments

What would you like to be added: Some way of overriding or extending the json settings used to serialize the UI Report. Eg. make a new static function taking a Lazy<JsonSerializerOptions> as argument and returning a Func<HttpContext, HealthReport, Task>.

Why is this needed: UIResponseWriter fills almost all of my needs when it comes to giving detailed responses to health checks from my services, even when I am not using the rest of the Health Check UI. However, the fact that it doesn't "pretty-print" the json (writes it indented) makes it slightly less usable, and I couldn't find any way to override the json settings without replacing the entire class.

It's a tiny feature, but it would make it possible to re-use this otherwise very useful functionality in other health check cases.

terjew avatar Mar 14 '24 11:03 terjew