← Back to Pull requests

perf(epforwarder): stop building pipelines the noop forwarder discards #54480

Closed
unknown closed this pull request without merging on Aug 10, 2026 17:03 UTC
View on GitHub
unknown unknown commented on Aug 05, 2026 15:17 UTC
Author

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 strategy to nil, throwing away the just-built endpoints, senders and destinations.
=> It now builds only what it keeps.

To make that happen, newDefaultEventPlatformForwarder now takes a pipelineFactory saying 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_size still decides how many events a check run can hold.
Working it out no longer needs the endpoints, only the configured value, hence LogsConfigKeys.inputChanSize becomes exported and both forwarders now share effectiveInputChanSize to factor out the buffer size selection.

This downsizing surfaces a trail of dead logscompression parameters which no longer had a single reader, thus also removed here.

Motivation


Start and Stop skip a pipeline whose strategy is nil, 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 check and cluster-agent check pay it once per run, tests far more often: through mocksender alone 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, benchstat over 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=atomic used 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_size values: all 231 buffers match.

497 tests pass across comp/forwarder, comp/aggregator, pkg/aggregator, pkg/serverless, comp/notableevents and comp/logs/agent/config, and golangci-lint is clean on the two packages this touches.

Additional Notes


The nil check in Start and Stop is untouched and still does the skipping: only the way strategy reaches nil changes, from being overwritten after the fact to being left unset.

Diff: 331 lines (+248 / -83) across 4 files Reviewer: Pierre-L42 Review duration: 7305m
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
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 42.1% (MEDIUM) · Higher = larger blast radius
42.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16.6% · Safe to merge
16.6%