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

Add Support for Microsoft.Extensions.Diagnostics.IHealthCheck? #23

Closed
Aaronontheweb opened this issue Apr 3, 2022 · 11 comments
Closed

Comments

@Aaronontheweb
Copy link
Member

Is your feature request related to a problem? Please describe.

We have a couple of different implementations for health-checks floating around in Akka.NET - all of them expressing the same idea: let the platform supervisor (i.e. Kubernetes, Cloud, process monitor etc) know when the Akka.NET service is degraded as a result of common problems:

  • Inability to join cluster;
  • Akka.Persistence being unavailable;
  • Failure to start ActorSystem (i.e. an Akka.Remote port binding failure.)

The first implementation is one I rolled myself a few years ago - and it works well enough: https://github.com/petabridge/akkadotnet-healthcheck - however, it definitely suffers from byte rot to some degree and there isn't a "one liner" way of integrating it with something like ASP.NET.

The second implementation, which is not fully baked as far as I know, is inside Akka.Management's HTTP APIs: https://github.com/akkadotnet/Akka.Management/tree/dev/src/management/Akka.Management#exposed-rest-api-endpoints - this takes a hard dependency on ASP.NET and you basically have to ship your Akka.NET application with a lightweight HTTP API on top of it. Plus, I don't think those checks are configurable beyond whether or not a cluster has been formed.

Describe the solution you'd like

Micrsoft.Extensions.Diagnostics.IHealthCheck provides a somewhat standard way of plugging healthcheck infrastructure together through the HealthCheckService class. Since Akka.Hosting is already built around the Microsoft.Extensions.[DI|Hosting|Configuration] libraries anyway, why not support having pluggable healthchecks from services like Akka.Management or Akka.Persistence available as options on the builder interface here?

Describe alternatives you've considered

Making Akka.Management the end-all-be-all for this.

@Aaronontheweb
Copy link
Member Author

cc @Arkatufus

@Arkatufus
Copy link
Contributor

It is technically the same thing as the health check inside Akka.Management but with a better interface and integration with ASP.NET. It will still need a web API to be accessed from the outside world.

@Aaronontheweb
Copy link
Member Author

@Arkatufus
Copy link
Contributor

Well, the interface itself is only a contract for it to be called by the HealthCheck service. The service itself will hook itself into a route in ASP.NET.
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-6.0#use-health-checks-routing

@Aaronontheweb
Copy link
Member Author

Yeah by the looks of it - it all appears to be very ASP.NET-centric

@Aaronontheweb
Copy link
Member Author

So end to end delivery is going to be the end-users' problem - we're not going to implement the healthcheck services for them, only register the Akka.NET IHealthCheck implementations.

"How do I expose this data to Kubernetes / {insert hosting option here}?" - "not our problem" and provide them with a link to the standard MSFT documentation on the subject

@wesselkranenborg
Copy link

@Aaronontheweb: is this something which is already being worked on? We want to have the Akka.Persistence and Akka.Cluster parts of https://github.com/petabridge/akkadotnet-healthcheck wrapped in an IHealthCheck (we will wire it up ourselves as we need to combine it with a lot of other healthchecks also). Just a question to see if anything here is in progress, not that we build it ourselves and then after a few days you have built it also 😀.

@Aaronontheweb
Copy link
Member Author

Not actively being worked on at the moment, but something we would like to do!

@Aaronontheweb Aaronontheweb changed the title Add Support for Micrsoft.Extensions.Diagnostics.IHealthCheck? Add Support for Microsoft.Extensions.Diagnostics.IHealthCheck? Oct 28, 2022
@wesselkranenborg
Copy link

Example implementation for support for IHealthCheck together with Akka.HealthCheck is made here: petabridge/akkadotnet-healthcheck#146

@Aaronontheweb Aaronontheweb added this to the Akka.Hosting 1.0 milestone Nov 14, 2022
@Arkatufus
Copy link
Contributor

Arkatufus commented Dec 6, 2022

Draft for IHealthCheck integration: petabridge/akkadotnet-healthcheck#148

@Arkatufus
Copy link
Contributor

Resolved by petabridge/akkadotnet-healthcheck#148

Repository owner moved this from Todo to Done in Akka.NET v1.5 Total Delivery Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants