[GSoC 2026] Kafka Streams runner: surface SDK-harness metrics as MetricResults#39341
Conversation
…icResults Collect the MonitoringInfos the SDK harness reports with each bundle and expose them as Beam MetricResults, following the Flink pattern: the translation context owns a MetricsContainerStepMap with one container per executable stage, the stage processor folds the harness's reports into its container on bundle progress and completion (replacing BundleProgressHandler.ignored()), and the pipeline result implements metrics() via asAttemptedOnlyMetricResults. KafkaStreamsTestRunner.run now returns the MetricResults so tests can assert on user counters. Attempted values only for now; committed metrics need to be folded into the exactly-once commit and land with the durability work. This is the surface PAssert uses to verify its assertions ran, so it is a prerequisite for the @ValidatesRunner suite.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enables the Kafka Streams runner to surface SDK-harness metrics as MetricResults. By integrating MonitoringInfos collection into the bundle processing lifecycle, the runner can now report attempted metrics, which is a critical prerequisite for supporting the @ValidatesRunner test suite and PAssert verification. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements user metrics reporting from the SDK harness in the Kafka Streams runner by capturing cumulative bundle metrics on completion and exposing them via MetricsContainerStepMap. The reviewer identified a critical concurrency issue where parallel tasks in a multi-partition topology would overwrite each other's metrics if they shared a single global map. To address this, the reviewer provided a comprehensive set of suggestions to instantiate, register, and merge task-specific metrics accumulators across all partitions when querying metrics.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Assigning reviewers: R: @shunping added as fallback since no labels match configuration Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
je-ik
left a comment
There was a problem hiding this comment.
Cool, let me know if you want to add the log of the responses, if not I'm ready to merge this as is.
75adf49
into
apache:feat/18479-kafka-streams-runner-skeleton
Summary
Collects the MonitoringInfos the SDK harness reports with each bundle and exposes them as Beam MetricResults. Part of #18479, first step toward the @ValidatesRunner suite -- PAssert verifies its assertions ran via a success counter it reads from PipelineResult.metrics(), which previously threw not-implemented.
Follows the Flink pattern (FlinkExecutableStageFunction):
Test: MetricsTest runs Create.of(1, 2, 3) through a counting DoFn in the EMBEDDED harness and asserts the user counter reads 3 through the runner's MetricResults.
Next up (separate PRs): a TestPipeline-dispatchable runner harness, then the validatesRunner gradle task with the first enabled tests.