-
Notifications
You must be signed in to change notification settings - Fork 2k
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 a healthcheck to the companion #5634
base: main
Are you sure you want to change the base?
Conversation
Diff output filesdiff --git a/packages/@uppy/companion/lib/companion.js b/packages/@uppy/companion/lib/companion.js
index 055c7ec..5da3e96 100644
--- a/packages/@uppy/companion/lib/companion.js
+++ b/packages/@uppy/companion/lib/companion.js
@@ -84,6 +84,7 @@ module.exports.app = (optionsArg = {}) => {
app.use(middlewares.metrics({ path: options.server.path }));
}
app.use(cookieParser()); // server tokens are added to cookies
+ app.get("/health", (req, res) => res.send("OK"));
app.use(interceptGrantErrorResponse);
// override provider credentials at request time
// Making `POST` request to the `/connect/:provider/:override?` route requires a form body parser middleware: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using the /metrics endpoint for this?
I disabled /metrics because I didn't want server metrics to be publicly available. |
It's a better health indicator imho tho because
|
Okay do you want me to remove the new endpoint and just update the kube docs to use /metrics as the readiness probe? |
Yeah that would be good! |
@@ -98,6 +98,7 @@ module.exports.app = (optionsArg = {}) => { | |||
} | |||
|
|||
app.use(cookieParser()) // server tokens are added to cookies | |||
app.get('/health', (req, res) => res.send('OK')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe in the future we want to send some json data here. so users should not expect an "OK" text here.
app.get('/health', (req, res) => res.send('OK')) | |
app.get('/health', (req, res) => res.end()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was leaning towards just using /metrics for this Mikael, it’s a more trustworthy check, end we don’t need to introduce a second health-y endoint then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds good to me
This will let me set a readiness probe for the pods