feat(generator): add per-process scraper to hostmetrics - #295
Open
chelseawright7 wants to merge 1 commit into
Open
feat(generator): add per-process scraper to hostmetrics#295chelseawright7 wants to merge 1 commit into
chelseawright7 wants to merge 1 commit into
Conversation
The existing `processes` scraper reports host-wide counts (system.processes.count) only, so nothing in blitz emitted per-process telemetry. The new `process` scraper emits process.memory.usage, process.memory.virtual, process.cpu.time, process.disk.io, process.threads and process.open_file_descriptors. Each record carries its own resource map with the process identity: pid, parent_pid, executable name and path, command, command_line, command_args, owner and — on Linux — cgroup. That resource-level identity is what makes process metrics high cardinality, and therefore what reduction and normalization pipelines act on; placing it in datapoint attributes instead would not exercise the same code paths downstream. The simulated process table varies by the configured OS (Linux daemons vs Windows services), and always contains daemons under 1 MiB resident so memory-threshold filters have something to drop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Change
Split out of #294 per review — that PR is now journald data library only, and this one carries the scraper on its own.
The existing
processesscraper reports host-wide counts (system.processes.count) only, so nothing in Blitz emitted per-process telemetry. The newprocessscraper emits:process.memory.usageByprocess.memory.virtualByprocess.cpu.timestatesprocess.disk.iodirectionByprocess.threads{thread}process.open_file_descriptors{count}Each record carries its own resource map with the process identity —
process.pid,process.parent_pid,process.executable.name,process.executable.path,process.command,process.command_line,process.command_args,process.owner, and on Linuxprocess.cgroup. That resource-level identity is what makes process metrics high cardinality, and therefore what reduction and normalization processors act on; putting it in datapoint attributes instead would not exercise the same downstream code paths.The simulated process table varies by
generator.hostmetrics.os(Linux daemons vs Windows services), and always contains daemons under 1 MiB resident so memory-threshold filters have something to drop.Checklist
go build ./...,go test ./...,make lintandmake security(178 files, 0 issues) all pass.New unit tests in
generator/hostmetrics/process_test.gocover: resource-attribute placement, that the shared base resource map is never mutated by a scrape, that each template gets a distinct resource map, that a scrape yields processes both under and over 1 MiB resident, Windows-specific behavior (.exenames, nocgroup), and command-line assembly with and without args. Existing scraper-count assertions updated 8 → 9.Smoke-tested through the CLI:
blitz --generator-type hostmetrics --generator-hostmetrics-scrapers process \ --output-type stdout --generator-count 4