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

Reduce log spam #25

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class JsonRpcServer {
ws.on("close", () => {
onChannelClose(channelId);
this.#channels.delete(channelId);
this.#logger.info({ channelId }, "Channel closed");
this.#logger.debug({ channelId }, "Channel closed");
});

this.#channels.set(channelId, channel);
Expand Down
9 changes: 5 additions & 4 deletions server/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ export const httpProxyApp = (
} else {
res.status(response.status).send(response.data);
}
} catch (e: any) {
logger.error({ error: e }, "error handling request");
} catch (error: any) {
logger.error({ error, spammy: true }, "Error handling request");
if (
// Timeout waiting for response on the the websocket channel
e.message === "Request timeout" ||
error.message === "Request timeout" ||
// Timeout in axios client from proxy to target service (e.g. Kubernetes API server) - "timeout of 1000ms exceeded"
(e.message.startsWith("timeout") && e.message.endsWith("exceeded"))
(error.message.startsWith("timeout") &&
error.message.endsWith("exceeded"))
) {
res.sendStatus(504);
} else {
Expand Down
Loading