@@ -474,7 +474,7 @@ The agent is an `EventEmitter`. All events are emitted on the `ArgusAgent` insta
474474
475475| Event | Payload | When |
476476| ---| ---| ---|
477- | ` 'anomaly' ` | ` ProfilerEvent ` | Memory leak, event loop lag, CPU spike detected |
477+ | ` 'anomaly' ` | ` ProfilerEvent ` | Memory leak, event loop lag, CPU spike, or cross-signal compound anomaly |
478478| ` 'query' ` | ` { sanitizedQuery, durationMs, driver?, traceId?, correlationId?, cacheHit?, suggestions? } ` | DB query completed |
479479| ` 'slow-query' ` | ` SlowQueryRecord ` | Query exceeded the per-driver threshold |
480480| ` 'transaction' ` | ` TransactionEvent ` | BEGIN/COMMIT/ROLLBACK pattern completed |
@@ -485,18 +485,20 @@ The agent is an `EventEmitter`. All events are emitted on the `ArgusAgent` insta
485485| ` 'http' ` | ` { method, url, statusCode, durationMs, suggestions } ` | HTTP request completed |
486486| ` 'dns' ` | ` DnsEvent ` | DNS lookup completed |
487487| ` 'slow-dns' ` | ` DnsEvent ` | DNS lookup exceeded ` slowThresholdMs ` |
488- | ` 'fs' ` | ` { operation, path, durationMs, suggestions } ` | File system operation completed |
488+ | ` 'fs' ` | ` { operation, path, durationMs, suggestions } ` | File system operation completed (suggestions include ` sync-in-hot-path ` when called inside a request) |
489489| ` 'log' ` | ` { level, scrubbed, durationMs, suggestions? } ` | ` console.* ` call intercepted |
490490| ` 'crash' ` | ` CrashEvent ` | ` uncaughtException ` or ` unhandledRejection ` received |
491491| ` 'leak' ` | ` ResourceLeakEvent ` | Active OS handle count exceeded threshold |
492- | ` 'scan' ` | ` StaticScanResult[] ` | Background ` tsc ` /ESLint scan complete (dev/test only) |
492+ | ` 'scan' ` | ` StaticScanResult[] ` | Background ` tsc ` /ESLint/connection-pool scan complete (dev/test only) |
493493| ` 'audit' ` | ` AuditResult ` | ` npm audit ` CVE scan complete (dev/test only) |
494494| ` 'info' ` | ` string ` | Advisory messages (e.g., auto-detection found nothing) |
495495| ` 'error' ` | ` Error ` | Non-fatal internal error (e.g., heap snapshot write failed) |
496496
497497``` typescript
498498agent .on (' anomaly' , (event ) => {
499- console .log (event .type ); // 'memory-leak' | 'event-loop-lag' | 'cpu-spike'
499+ // runtime: 'memory-leak' | 'event-loop-lag' | 'cpu-spike'
500+ // cross-signal: 'correlated-slow-endpoint' | 'pool-starvation-by-slow-query' | 'n-plus-one-in-transaction'
501+ console .log (event .type );
500502 console .log (event .heapSnapshotPath ); // only set when a snapshot write succeeded
501503});
502504
@@ -569,7 +571,7 @@ All thresholds can be overridden without code changes, making the agent CI/CD an
569571| ` .withInstrumentation(opts?) ` | ✅ Yes | Low | DB/IO tracing via ` diagnostics_channel ` (16 drivers) |
570572| ` .withHttpTracing() ` | ✅ Yes | Low | HTTP request inspection & slow-request detection |
571573| ` .withLogTracing(opts?) ` | ✅ Yes | Low | ` console.* ` override with entropy-scrubbed payloads |
572- | ` .withFsTracing() ` | ❌ ** No** | High | Patches ` fs ` . Detects ` *Sync ` blockers. ** DEV ONLY.** |
574+ | ` .withFsTracing() ` | ❌ ** No** | High | Patches ` fs ` . Detects ` *Sync ` blockers; escalates to ` sync-in-hot-path ` (critical) when called inside a live request . ** DEV ONLY.** |
573575| ` .withQueryAnalysis() ` | ✅ Yes | Medium (AST) | N+1 detection + query fix suggestions |
574576| ` .withSlowQueryMonitor(opts?) ` | ✅ Yes | Very Low | Per-driver slow query detection + top-N log |
575577| ` .withTransactionMonitor(opts?) ` | ✅ Yes | Very Low | BEGIN/COMMIT/ROLLBACK duration tracking |
@@ -578,7 +580,7 @@ All thresholds can be overridden without code changes, making the agent CI/CD an
578580| ` .withPoolMonitor(opts?) ` | ✅ Yes | Low | Connection pool exhaustion & slow-acquire |
579581| ` .withDnsMonitor(opts?) ` | ✅ Yes | Low | DNS lookup latency tracking |
580582| ` .withAdaptiveSampler(opts?) ` | ✅ Yes | Very Low | Token-bucket rate limiter under high load |
581- | ` .withStaticScanner(dir) ` | ❌ ** No** | High | Background ` tsc ` /ESLint scan. ** DEV ONLY.** |
583+ | ` .withStaticScanner(dir) ` | ❌ ** No** | High | Background ` tsc ` /ESLint scan + TypeScript AST walk for connection-pool misuse ( ` missing-connection-pool ` ) . ** DEV ONLY.** |
582584| ` .withAuditScanner(dir) ` | ❌ ** No** | High | Spawns ` npm audit ` . ** DEV/startup ONLY.** |
583585| ` .withExporter(config) ` | ✅ Yes | Very Low | OTLP JSON export over mTLS |
584586| ` .withAggregatorWindow(ms) ` | ✅ Yes | None | Override p99 sliding window (default: 60 s) |
0 commit comments