← back to Cncp Failure Collector
feat(collector): per-process benign-noise filter for known transient sources
e29519581fc7c8a12e149487ec448c5d6a97e969 · 2026-05-11 20:44:59 -0700 · SteveStudio2
Files touched
Diff
commit e29519581fc7c8a12e149487ec448c5d6a97e969
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Mon May 11 20:44:59 2026 -0700
feat(collector): per-process benign-noise filter for known transient sources
---
index.js | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/index.js b/index.js
index 4294b1a..6330e82 100644
--- a/index.js
+++ b/index.js
@@ -47,6 +47,29 @@ const PM2_LOG_DIR = path.join(os.homedir(), '.pm2', 'logs');
function log(...a) { console.log(new Date().toISOString(), ...a); }
+// Per-process patterns that match expected, non-actionable log noise.
+// If EVERY non-empty line in a new log chunk matches the regex, we skip posting.
+const BENIGN_NOISE_PATTERNS = {
+ // cloudflared rotates edge connections every ~16s; the reconnect cycle logs
+ // ERR but it's normal heartbeat behavior, not a failure.
+ 'big-red-tunnel': /Tunnel connection curve preferences|failed to run the datagram handler.*context canceled|failed to serve tunnel connection.*control stream encountered|Serve tunnel error.*control stream encountered|Retrying connection in up to|Failed to dial a quic connection.*handshake did not complete in time|^\{.*"level":"(info|error)".*\}$/,
+ // microsite-hawk emits cycle-complete on success — should be stdout, but
+ // belt-and-suspenders in case the source fix regresses.
+ 'microsite-hawk': /^\[hawk\] Cycle complete .* failures: 0/,
+ // abrams-report scrapers log vendor HTTP 4xx/timeouts as warnings; these are
+ // vendor-side issues, not actionable code bugs.
+ 'abrams-report-scrape': /^\[(html|rss)\] [a-z0-9-]+ failed: (HTTP 4\d\d|Request timed out|network timeout)/,
+ 'abrams-report-wallpaper': /^\[(html|rss)\] [a-z0-9-]+ failed: (HTTP 4\d\d|Request timed out|network timeout)/,
+};
+
+function isBenignNoise(processName, chunk) {
+ const pat = BENIGN_NOISE_PATTERNS[processName];
+ if (!pat) return false;
+ const lines = chunk.split('\n').map(l => l.trim()).filter(Boolean);
+ if (lines.length === 0) return true;
+ return lines.every(l => pat.test(l));
+}
+
function loadState() {
try {
if (fs.existsSync(STATE_FILE)) return JSON.parse(fs.readFileSync(STATE_FILE, 'utf-8'));
@@ -260,6 +283,12 @@ async function scanLaunchdErrLogs(state) {
if (!meaningful) { state.logOffsets[errPath] = cur; continue; }
const processName = label.replace(/^com\.steve\./, '');
+ // Per-process known-benign-noise filter. Each entry: if EVERY non-empty line
+ // in the chunk matches the regex, advance the offset without posting.
+ if (isBenignNoise(processName, chunk)) {
+ state.logOffsets[errPath] = cur;
+ continue;
+ }
const posted = await postTask({
source: 'launchd',
processName,
← 064993f tick 9: cross-platform — also runs on Kamatera, host-tagged
·
back to Cncp Failure Collector
·
feat(collector): also filter nginx TLS handshake bot noise b3aa723 →