Open thompson-tomo opened 10 months ago
Why does this need to be in the box? Why not write one for your on prem software?
Writing one is not the issue, I am more than happy to write it & then it submit it as a PR etc. I am more thinking for key Microsoft libraries ie logger, System.DiagnosticSource should the appropriate publisher be provided in a similar manner to configuration, logging or do we simply rely on third parties to manage it in it's entirety.
For instance with the System.Diagnostic publisher it would then facilitate aspire to visualise the result of the health checks.
If there were a set of concrete scenarios then we would add this. I'll leave this open but I don't see a reason to add this to the framework.
So the scenarios, I see would be Aspire & OTEL more broadly as they could utilise the metrics such a publisher would have access to & would be able to provide.
At the same time having a publisher writing to logs is useful not just for my case but also for general debugging/development.
Right, if that how aspire choses to implement health checks (which isn't the plan right now), that would be a +1, but we don't have a logging publisher as a scenario for health checks.
I have reworked the description to make it more descriptive and it now encompasses the 2 use cases with the scenarios for each mentioned. Obviously Aspire would fall under the DiagnosticSource option.
Summary
I want to have some general Health publisher's available which publish to common targets ie log file, System.Diagnostic.
Motivation and goals
I want to make it as easy as possible for developers to be able record the results of the configured health checks and monitor them over time. It should not matter if on-premise or cloud software.
With this change I will be able to collect log files from site & to see what the health has been for a period of time. Note A key thing would be to ensure that appropriate log levels are used
In scope
Release of new nuget package
Out of scope
Supporting any logger other Microsoft.Extensions.Logger
Examples
The idea is to make it as simple for developer to enable and as such the idea would be:
Or
Obviously it should be possible to define the HealthCheckPublisherOptions just like if it was explicitly added.
Detailed design
To eliminate log spam The following mapping of the health status is needed.
For diagnostic source the key thing is all the attributes of report data are exposed as attributes.