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

Hosting the Health Check routes in an existing Akka HTTP server #599

Open
sdeigm opened this issue Oct 8, 2019 · 7 comments
Open

Hosting the Health Check routes in an existing Akka HTTP server #599

sdeigm opened this issue Oct 8, 2019 · 7 comments

Comments

@sdeigm
Copy link

@sdeigm sdeigm commented Oct 8, 2019

Hosting the Akka HTTP managment routes in an existing HTTP server currently only provides access to the routes dealing with the the cluster membership and status, not the Health Check routes.

It would be good to also include the Health Check routes (readiness and liveness) into this interface so that they can be reached at the same port address as the other routes. This avoids the opening of another HTTP server port for just that reason.

@TimMoore
Copy link

@TimMoore TimMoore commented Oct 9, 2019

It looks to me like AkkaManagement(system).routes will give you all of the configured routes, including health checks.

/**
* Get the routes for the HTTP management endpoint.
*
* This method can be used to embed the Akka management routes in an existing Akka HTTP server.
*
* @throws IllegalArgumentException if routes not configured for akka management
*/
def routes: Route = prepareCombinedRoutes(providerSettings)

@sdeigm could you try that and report back?

@akka/akka-team, should that be the documented approach?

https://doc.akka.io/docs/akka-management/current/cluster-http-management.html#hosting-the-routes-in-an-existing-akka-http-server

@johanandren
Copy link
Member

@johanandren johanandren commented Oct 9, 2019

There is one difference though and that is that it potentially adds modifying routes, join cluster, down node etc. While health check alone would perhaps be less dangerous.

@TimMoore
Copy link

@TimMoore TimMoore commented Oct 9, 2019

Good point. It would definitely be useful to be able to get hold of the health check routes on their own. My interpretation of the original post was that @sdeigm wanted both anyway, but maybe not.

@sdeigm
Copy link
Author

@sdeigm sdeigm commented Oct 9, 2019

@sdeigm could you try that and report back?

I just tried it out and it works. A /alive and a /ready route are added to my server. Thanks for the tip!

And yes you are correct @TimMoore, in my case I want the routes to modify the cluster membership anyway. So for me personally, this solves the issue, but for others that might be a problem.

@TimMoore
Copy link

@TimMoore TimMoore commented Oct 9, 2019

Thanks for confirming @sdeigm ... this should at least be documented somewhere, IMHO, so maybe we can leave the issue open for that?

@TimMoore
Copy link

@TimMoore TimMoore commented Oct 29, 2019

A request to allow embedding only the health check routes in an existing server is in #605.

@chbatey
Copy link
Member

@chbatey chbatey commented Nov 12, 2019

Thanks for confirming @sdeigm ... this should at least be documented somewhere, IMHO, so maybe we can leave the issue open for that?

Leaving open for improving the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.