dotnet-architecture / HealthChecks

Experimental Health Checks for building services, such as with ASP.NET Core
Other
454 stars 124 forks source link

Enhance grouping feature #53

Open ycrumeyrolle opened 7 years ago

ycrumeyrolle commented 7 years ago

The group feature allow to aggregate differents health checks into one. I would like to use HealthChecks for both application monitoring and as circuit breaker for some features of my applications. i.e. I have a e-commerce web site with a payment feature. The payment feature is based on a payment service, a payment-related certificate and an azure storage. I will create a group for the payment with the three components. By doing so, I will be able to disable the payment on the web site when any payment-related component
will be unavailable.

I have my ops teams that are responsible to monitor the low-level component. I have a team responsible of the certificate management, a team responsible of the web service availability, ...

I would like to be able to have more than one group per IHealthCheck. For example the "web service" group & the "payment" group. The IHealhCheckService.CheckHealthAsync() may require a new parameter giving the ability to desired group to check, or all the checks as currently.

@bradwilson @JuergenGutsch

bradwilson commented 7 years ago

After discussion, we decided that we would want to preserve the grouping feature as-is. If we were to add this as a feature, we would consider it to be orthogonal, and call it "tags"; that is, when you register a health check (inside a group or not), you would optionally be able to apply one or more tags to that check. Then we would offer an API to retrieve the list of checks in a tag.

My guess is people would probably use either groups or tags (not both), but we wouldn't want to prohibit that behavior if it was desired; the primary value of groups here over tags is the notion of how to treat partial success. Tags would not have such a thing, nor would tags be used to provide any kind of "grouping" in the raw results. It would be up to the end user to either filter results by tag after running all checks, or to retrieve checks by tag and just run that particular subset.

Thoughts?

ycrumeyrolle commented 7 years ago

Tags is a much better term.

I prefer the option of selecting by tag then run this subset. This avoid to run unnecessary checks and some undesirable behaviors.