perf(epforwarder): stop building pipelines the noop forwarder discards #54480
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 331 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.347
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #54480"
general
weight: 0.35
Pierre-L42
What does this PR do?
The "noop" event platform forwarder has been building every one of its pipelines in full, then going back and setting every
strategytonil, throwing away the just-built endpoints, senders and destinations.=> It now builds only what it keeps.
To make that happen,
newDefaultEventPlatformForwardernow takes apipelineFactorysaying how each pipeline is built:1. the sending forwarder passes one calling
newHTTPPassthroughPipeline, as before,2. the noop forwarder passes a factory that sets only the input channel and event receiver.
The latter's input channel keeps the size a full pipeline would have given it, so
input_chan_sizestill decides how many events a check run can hold.Working it out no longer needs the endpoints, only the configured value, hence
LogsConfigKeys.inputChanSizebecomes exported and both forwarders now shareeffectiveInputChanSizeto factor out the buffer size selection.This downsizing surfaces a trail of dead
logscompressionparameters which no longer had a single reader, thus also removed here.Motivation
StartandStopskip a pipeline whose strategy isnil, and nothing reads a pipeline's other fields, so none of that discarded work was ever observable.It costs 10090 allocations and 2.8MiB each time.
agent checkandcluster-agent checkpay it once per run, tests far more often: throughmocksenderalone the noop forwarder is reached by 107 test files across 76 packages, and some build dozens in a row.Describe how you validated your changes
Building one noop forwarder,
benchstatover 10 runs a side:| metric | before -> after | |
|---|---|---|
| allocs/op | 10090.0 -> 165.0 | -98.36% |
| B/op | 2866.6Ki -> 203.8Ki | -92.89% |
| sec/op | 6448.0u -> 165.0u | -97.44% |
This also benefits timings under the
-race -covermode=atomicused in test jobs, for instance:| package | before -> after | |
|---|---|---|
|
pkg/serverless/metrics| 7.15s -> 1.81s | -75% ||
pkg/collector/corechecks/system/disk/diskv2| 17.83s -> 13.59s | -24% |Every pipeline was compared against its sending counterpart over 11 configured
input_chan_sizevalues: all 231 buffers match.497 tests pass across
comp/forwarder,comp/aggregator,pkg/aggregator,pkg/serverless,comp/notableeventsandcomp/logs/agent/config, andgolangci-lintis clean on the two packages this touches.Additional Notes
The
nilcheck inStartandStopis untouched and still does the skipping: only the waystrategyreachesnilchanges, from being overwritten after the fact to being left unset.