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

Request for an application health check #50

Open
crisbratu opened this issue Jun 19, 2015 · 2 comments
Open

Request for an application health check #50

crisbratu opened this issue Jun 19, 2015 · 2 comments

Comments

@crisbratu
Copy link

Hey mixu,

We've been running npm_lazy 1.7.0 for a few months, and it's working great. However once in a while the application needs to be restarted due to errors. Would a healthcheck endpoint be feasible to implement? Or is there an easy way, besides trying to hit it with http requests?

Thanks,
Cris

@mixu
Copy link
Owner

mixu commented Jun 19, 2015

@crisbratu nice, glad to hear that! You could simply check whether some random package index is fetchable, e.g. curl -vvv localhost:8080/starwars. I'm also open to adding a health check endpoint, as long as it doesn't conflict with existing npm urls, e.g. https://github.com/npm/npm-registry-couchapp/blob/master/registry/rewrites.js

@mrmarcsmith
Copy link

This would be a nice feature.
I imagine a good place to start would be a simple call and response.

localhost:8080/health returning {"status":"ok"}

not necessarily making a call to npm but just to make sure the process is alive. In Kubernetes, if a container doesn't respond within a given timeout its restarted. we wouldn't want a health check making an external call every 15 seconds and the container could be unnecessarily restarted if npm take longer than a second or so to respond.

@mixu thoughts?

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

No branches or pull requests

3 participants