otel: fix typeperf scrape mangled by cmd.exe quoting - #7
Conversation
The otel export scraped host CPU/mem with: typeperf "\Processor(_Total)\% Processor Time" "\Memory\Available Bytes" -sc 1 run through the agent's cmd.exe /c shell. cmd.exe mangles the counter path's '%' and spaces, so typeperf receives it truncated at '\%', reports "No valid counters", and exits 0xF0000002 (4026531842). Every scrape failed -> the VM was marked unreachable and no metrics were emitted, even though the perf counters are healthy. Run typeperf with an explicit argv via the python subprocess passthrough (buildSubprocessPy, shell=False) instead of cmd.exe -- the same cmd.exe command-line quoting workaround already used for reg.exe in runRegPassthrough. Verified against the live VM: returns valid PDH-CSV CPU% and Available Bytes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 3 minutes and 4 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR refactors the ChangesTypeperf subprocess execution refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The python passthrough's text-mode stdout on Windows rewrites typeperf's \r\n line endings to \r\r\n. encoding/csv then fails to parse the data row, so host.cpu.utilization / host.memory.available were never emitted (scrape still 'succeeded' rc=0, so the VM showed reachable but with no CPU/mem). Normalize by stripping all CRs before CSV parsing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… types)
eventquery.vbs renders the Type column in lower case on this XP build
("information"/"warning"/"error"), but isEventType and severityFor only
matched Title case. parseEventCSV therefore never located the type column,
returned zero entries, and EmitLogs was never called -- so the logs signal
emitted nothing (metrics were fine; reachable=1 with no event logs). Match
case-insensitively in both. Verified: parseEventCSV now returns entries for
lowercase eventquery output.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…time eventquery.vbs reports event times in the host's local clock with no tz. The collector parsed them as its own tz (UTC), so a Pacific VM's events landed ~7h in the past -- invisible in normal SigNoz time windows even though they were ingested fine. Use the scrape (observed) time as the record timestamp for this near-real-time, no-backfill tailer, and keep the host-local clock as an 'event.time' attribute. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
xpc otel exportscraped host CPU/mem with a quoted typeperf counter path run through the agent'scmd.exe /cshell. cmd.exe mangles the%and spaces in\Processor(_Total)\% Processor Time, so typeperf receives it truncated at\%, reports No valid counters, and exits0xF0000002(4026531842). Every scrape failed → the VM was marked unreachable and no metrics were emitted (this showed up as ~5.9k ERROR logs/day in SigNoz from xpc-otel on mon-01).The perf counters themselves are healthy (
typeperf -q Processorlists them). Fix: run typeperf with an explicit argv via the python subprocess passthrough (buildSubprocessPy,shell=False) instead of cmd.exe — the same command-line quoting workaround already used for reg.exe inrunRegPassthrough.Verified against the live VM: returns valid PDH-CSV
% Processor TimeandAvailable Bytes.🤖 Generated with Claude Code
Summary by CodeRabbit