Repository navigation
relay: the pprof upstream kind - #9
Merged
Merged
Conversation
A customer names Go processes as targets of one pprof upstream; Perfloop names one target per read as the first path segment. The relay forwards only GET to the six documented /debug/pprof routes, admits `seconds` as the only query key within the configured cap (profile must carry it), and refuses a further read at once when the per-process in-flight cap is reached. Every refusal happens before any upstream request and carries the relay's own marker on Perfloop-Relay-Error, so a reader tells it from the process's answer. -print-routes lists each target and the caps, per process. link carries the marker values and the seconds bound both ends share. Ported from perfloop/perfloop#4331 (0bf7906fc8, 2a5fec2b88, 53d50ae9de, 1ecd357bf0, aebcedfdd9, a1a05b8c96) over the hardening in ce5260e. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Adds the
pprofupstream kind. A user names Go processes as targets. The relay permits only GET requests to the six documented profiling routes, withsecondsas the only query key. Duration is bounded bymax_seconds(default 30, at most 45), andmax_concurrentlimits concurrent requests per process (default 1). Unknown targets, routes, methods, and queries are refused before reaching a process; a busy target returns 429 immediately. Route printing includes the targets and limits. The sharedlinkpackage exposes the corresponding error and limit values.Recorded proof:
go vetandgo test -race ./...passed, including refusal-boundary tests, the concurrency limit, and fuzz tests for routes and duration values.