Skip to content

fix(logging): exclude noisy health/telemetry paths from request logs#1948

Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
fix/exclude-noisy-paths-from-logging
Open

fix(logging): exclude noisy health/telemetry paths from request logs#1948
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
fix/exclude-noisy-paths-from-logging

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Apr 2, 2026

Summary

  • Exclude /global/health and /global/telemetry from KiloClaw worker request logging — these high-frequency paths (health polls, telemetry pings) flood worker logs with noise, making it harder to spot meaningful requests.
  • Also exclude /health from gastown container control-server request logging for the same reason.
  • Both use a QUIET_PATHS Set for O(1) lookups and easy extensibility.

Verification

  • Verified changes are syntactically correct and type-safe (simple Set<string> + .has() check with early return)
  • Typecheck could not be run locally due to missing tsgo binary and node_modules in the CI environment, but the change is trivially safe — it adds a constant Set and an if guard before existing code

Visual Changes

N/A

Reviewer Notes

  • The QUIET_PATHS pattern is intentionally a named constant (not inline) so future noisy paths can be added in one place.
  • The KiloClaw worker exclusion uses url.pathname (already computed) for the check; the control-server uses c.req.path (Hono's parsed path). Both are consistent with how the rest of each middleware already accesses the path.
  • Reported by a Discord user whose logs were flooded by /global/health requests.

Built for Mark IJbema by Kilo for Slack

/global/health and /global/telemetry requests fire very frequently
(health polls, telemetry pings) and flood worker logs. Add a
QUIET_PATHS set to skip logging for these high-frequency paths in
both the KiloClaw worker and the gastown container control server.

async function logRequest(c: Context<AppEnv>, next: Next) {
const url = new URL(c.req.url);
if (QUIET_PATHS.has(url.pathname)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Quiet-path check does not suppress the later proxy logs

This guard skips the top-level [REQ] line, but /global/health and /global/telemetry still hit the unconditional [PROXY] Handling request, [HTTP] Proxying, and [HTTP] Response status logs later in app.all('*', ...). The high-frequency polls will still flood worker logs, so this does not fully deliver the noise reduction described in the PR.

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Apr 2, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
kiloclaw/src/index.ts 80 Quiet-path filtering only skips the top-level request logger; later proxy logs still emit for /global/health and /global/telemetry, so the noisy traffic continues to flood logs.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
kiloclaw/src/index.ts 632 Catch-all proxy still logs [PROXY] Handling request for every request, including the quiet paths.
kiloclaw/src/index.ts 785 HTTP proxy path still logs [HTTP] Proxying and [HTTP] Response status for the quiet paths, which undermines the intended noise reduction.
Files Reviewed (2 files)
  • cloudflare-gastown/container/src/control-server.ts - 0 issues
  • kiloclaw/src/index.ts - 1 issue

Reviewed by gpt-5.4-20260305 · 544,398 tokens

Copy link
Copy Markdown
Contributor

@markijbema markijbema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad bot, this makes no sense at all

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

Successfully merging this pull request may close these issues.

1 participant