fix(bigtable): default cluster/zone in toOtelMetricAttrs to avoid Monitoring reject - #20178
Merged
sushanb merged 1 commit intoJul 21, 2026
Merged
Conversation
…itoring reject
Cloud Monitoring rejects bigtable_client_raw writes with an empty
zone/cluster ("Unrecognized region or location"). Empty values reach
toOtelMetricAttrs when an attempt errors before response headers/trailers
arrive (e.g. DEADLINE_EXCEEDED on the first attempt), so ExtractLocation
never runs and there's no lastClusterID/lastZoneID to fall back on.
Coerce empty -> defaultCluster/defaultZone unconditionally before assembling
the resource labels, matching the fallback ExtractLocation already returns
on failure.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates bigtable/internal/metrics/tracer.go to fall back to defaultCluster and defaultZone when clusterID and zoneID are empty. This prevents Cloud Monitoring from rejecting bigtable_client_raw writes when an attempt errors before response headers/trailers arrive. There are no review comments, so I have no feedback to provide.
sushanb
commented
Jul 20, 2026
alexoneill
approved these changes
Jul 20, 2026
mutianf
approved these changes
Jul 21, 2026
hongalex
pushed a commit
that referenced
this pull request
Jul 23, 2026
🤖 I have created a release *beep* *boop* --- ## [1.51.0](bigtable/v1.50.0...bigtable/v1.51.0) (2026-07-23) ### Features * **bigtable:** Add ChainInterceptors and RetryingVRpc for vRPC pipeline ([#20185](#20185)) ([c7a832a](c7a832a)) * **bigtable:** Add ClientConfigurationManager ([#19986](#19986)) ([3a8f927](3a8f927)) * **bigtable:** Add debug tag counter (recordDebugTag / assertDebugTag) ([#20114](#20114)) ([3c97590](3c97590)) * **bigtable:** Add lazyPool helper for on-demand session pool opening ([#20182](#20182)) ([f6ae3fb](f6ae3fb)) * **bigtable:** Add PeakEwma continuous time-decay latency tracker ([#20187](#20187)) ([9d124ef](9d124ef)) * **bigtable:** Add PoolSizer for server-driven session pool capacity ([#20189](#20189)) ([57ebbeb](57ebbeb)) * **bigtable:** Add session package with SessionClient + SessionTableAPI interfaces ([#20180](#20180)) ([4b82fd2](4b82fd2)) * **bigtable:** Add Session primitives (AttemptOutcome, vRPC ctx, msgtype) ([#20116](#20116)) ([e1011e2](e1011e2)) * **bigtable:** Add Session state enum ([#19981](#19981)) ([0748972](0748972)) * **bigtable:** Add SessionThrottler / AdaptiveSessionThrottler for OpenSession pacing ([#20184](#20184)) ([02e3c6d](02e3c6d)) * **bigtable:** Add SessionThrottler / AdaptiveSessionThrottler for OpenSession pacing ([#20184](#20184)) ([29be83e](29be83e)) * **bigtable:** Add sessionTracer for per-Session lifecycle + vRPC metrics ([#20190](#20190)) ([a466345](a466345)) * **bigtable:** Enable new auth library and JWT for instance admin client ([#20013](#20013)) ([21c4a44](21c4a44)) * **bigtable:** Modularize channel priming behind a ChannelPrimer interface ([#20027](#20027)) ([5214ab7](5214ab7)) * **bigtable:** Modularize Direct Access compatibility check ([#19987](#19987)) ([a25e93d](a25e93d)) * **o11y:** Regenerate clients for LRO tracing ([#20107](#20107)) ([779074e](779074e)) ### Bug Fixes * **bigtable:** Default cluster/zone in toOtelMetricAttrs to avoid Monitoring reject ([#20178](#20178)) ([14493f4](14493f4)) * **bigtable:** Eliminate stats-handler MD race in internal/metrics tracer ([#20158](#20158)) ([c387066](c387066)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.
Summary
Cloud Monitoring rejects
bigtable_client_rawwrites with an emptyzone/cluster (
"Unrecognized region or location"). Empty values reachtoOtelMetricAttrswhen an attempt errors before response headers/trailersarrive (e.g.
DEADLINE_EXCEEDEDon the first attempt), soExtractLocationnever runs and there's no
lastClusterID/lastZoneIDto fall back on.Coerce empty →
defaultCluster/defaultZoneunconditionally before assemblingthe resource labels, matching the fallback
ExtractLocationalready returnson failure (
<unspecified>/global).Test plan
go build ./bigtable/internal/metrics/...go test ./bigtable/internal/metrics/... -count=1