[adapters] Expose pipeline process swap usage as a Prometheus metric#6383
Open
sjhddh wants to merge 1 commit into
Open
[adapters] Expose pipeline process swap usage as a Prometheus metric#6383sjhddh wants to merge 1 commit into
sjhddh wants to merge 1 commit into
Conversation
Add a `process_swap_bytes` gauge to the pipeline process metrics, reporting how much of the process's memory is currently swapped out. A nonzero value tells operators the process is swapping, which degrades performance. On Linux the value is read from the `VmSwap` field of `/proc/self/status` (reported in kB and converted to bytes). On non-Linux platforms, or when the field is unavailable, the metric is omitted rather than reported as a misleading zero. Includes a unit test for the `VmSwap` parser covering the present, missing, zero, and malformed cases. Closes feldera#6382 Signed-off-by: sjhddh <151469562+sjhddh@users.noreply.github.com>
blp
approved these changes
Jun 3, 2026
Member
|
It would be good to update the documentation in |
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.
Describe Manual Test Plan
Adds a
process_swap_bytesgauge to the pipeline process metrics, reporting how many bytes of the process's memory are currently swapped out. A nonzero value tells operators the process is swapping, which degrades performance, as requested in #6382.On Linux the value is read from the
VmSwapfield of/proc/self/status(reported in kB and converted to bytes). On non-Linux platforms (e.g. macOS), or when the field is unavailable, the metric is omitted rather than reported as a misleading zero — consistent with how the otherprocess_*gauges inprocess_metricsare only emitted when present.Verified locally:
cargo fmt --all --check— cleancargo clippy -p dbsp_adapters— no new warningscargo build -p dbsp_adapters— buildscargo test -p dbsp_adapters --lib server::metrics— 3 passed, incl. the newparse_vm_swapunit test (present / missing / zero / malformedVmSwap).The Linux
/proc/self/statusread path itself was not exercised at runtime (developed on macOS), but theVmSwapparser is unit-tested cross-platform.Closes #6382