feat(capture): wire v1 sink router in production setup#59977
Merged
eli-r-ph merged 4 commits intoMay 26, 2026
Conversation
Conditionally build and register the V1 sink router when CAPTURE_V1_SINKS is non-empty. Pass it through the HTTP router state and flush it during graceful shutdown alongside the legacy sink. The env var defaults to "" so no deployment behavior changes until a deploy explicitly configures v1 sinks.
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
rust/capture/src/setup.rs:69-73
The final registration of `v1_sink` is the last use of `sink_opts`, so the `.clone()` is superfluous — `sink_opts` can be moved directly into `manager.register`. The clone allocates and drops immediately, which is unnecessary.
```suggestion
let v1_sink = if !config.capture_v1_sinks.is_empty() {
Some(manager.register("v1-sink", sink_opts))
} else {
None
};
```
Reviews (1): Last reviewed commit: "feat(capture): wire v1 sink router in pr..." | Re-trigger Greptile |
jose-sequeira
approved these changes
May 26, 2026
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
This PR wires up the real production router when configured.
Changes
v1_sinklifecycle handle toLifecycleHandles, registered conditionally whenCAPTURE_V1_SINKSis non-emptycreate_v1_sink_router()helper insetup.rsthat buildsKafkaProducer+KafkaSink+Routerwith richanyhow::Contexterror propagation on each stepv1_sink_router: Option<Arc<v1::sinks::Router>>toCaptureComponentsv1_sink_routeras a parameter torouter::router()instead of hardcodingNoneserver.rs(same pattern as legacy sink)create_v1_sink_routerThe
CAPTURE_V1_SINKSenv var defaults to""— no deployment behavior changes until a deploy explicitly sets the var. No consumer config is added.How did you test this code?
Locally and in CI.
Publish to changelog?
N/A
🤖 Agent context
Eli planned, Claude coded, Eli collected paycheck ✅