Repository navigation
fix(bigtable): preserve resource labels on batcher metrics - #18712
Open
AliAbouelazm wants to merge 1 commit into
Open
AliAbouelazm wants to merge 1 commit into
AliAbouelazm wants to merge 1 commit into
Conversation
Create batcher operation metrics through the target helper so project, instance, table, and app-profile labels reach the metrics exporter. Keep metric creation before flow-control waiting to preserve latency timing. Add sync and async regression tests for tables, authorized views, app profiles, multiple batches, and flow-control timing. Regenerate sync code and tests with CrossSync. Fixes googleapis#18546
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the mutations batcher (both async and sync autogenerated versions) to pass the target object instead of the metrics_controller to add_to_flow_with_metrics. This allows the batcher to delegate operation creation directly to the target via _create_operation, enabling better tracking of resource labels (such as project, instance, table, and app profile IDs) on client-side metrics. Additionally, unit tests have been added to verify metric resource labels and flow throttling behavior. There are no review comments to address, and I have no further feedback to provide.
AliAbouelazm
marked this pull request as ready for review
October 16, 2026 07:49
This branch has not been deployed
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.
Fixes #18546.
The mutations batcher creates operation metrics directly through the metrics controller, bypassing the resource labels supplied by the table or authorized view. The missing project label causes the exporter to drop these metrics and log a warning on each export.
Create each batch's metric through the target's existing
_create_operationhelper. Metrics still start before waiting for flow control, so operation and throttling latency measurements keep their existing timing. Regenerate the synchronous implementation and tests with CrossSync.Regression coverage includes tables and authorized views, default and explicit app profiles, multiple batches, and flow-control timing in both synchronous and asynchronous clients. The label regression fails before the fix in all eight configurations.
Validation:
The existing aggregate coverage gate remains below 99% on both untouched main and this branch: 98.330% before and 98.345% after. Every added executable line is covered.
Live Bigtable system tests were not run.