Add support for multiple service endpoints and process monitoring modes#785
Merged
thinkingfish merged 5 commits intomainfrom Apr 13, 2026
Merged
Conversation
…o capture scripts Both scripts now support multiple --endpoint/--source pairs for recording from several Prometheus-compatible services simultaneously. The main script gains --command and --pid as alternatives to --duration, tying the capture lifecycle to a running process. The Docker variant gains --pid support.
After recording, copy each source's parquet to the output directory with descriptive names (agent-<port>.parquet, <source>-<port>.parquet) before combining. This lets users view each source independently.
When an endpoint URL has no explicit port (e.g., http://host/metrics), the service parquet is named <source>-<pid>.parquet using the monitored PID instead. extract_port now validates the result is numeric.
When running under sudo, output files were owned by root. Now detects the real user via SUDO_USER and chowns the output directory and all parquet files to that user. Sets file mode to 755.
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.
Problem
The
rezolus-capturescripts currently support only a single service metrics endpoint and require a fixed duration for capture. This limits flexibility for:Solution
Enhanced both
scripts/rezolus-captureanddocker/rezolus-capturewith the following changes:Multiple Service Endpoints: Changed
ENDPOINTandSOURCEfrom single variables to arrays (ENDPOINTSandSOURCES), allowing users to specify multiple--endpointand--sourcepairs. Each endpoint is recorded to a separate temporary parquet file.Flexible Capture Modes: Replaced the required
--durationflag with three mutually exclusive capture modes:--duration <DURATION>: Capture for a fixed time period (original behavior)--command <CMD...>: Run a command and capture while it executes--pid <PID>: Monitor an existing process and capture until it exitsImproved Validation:
--pidEnhanced Recording Management:
RECORDER_PIDSarraystop_recorders()helper function for graceful shutdownFlexible Output Combination:
Documentation Updates:
Result
Users can now:
--command--pidfor dynamic monitoringThe changes maintain backward compatibility for the
--durationmode while adding powerful new capabilities for flexible metric collection scenarios.https://claude.ai/code/session_01WV3WMHXPjqKaWrNo6KJN2n