Repository navigation
fix(bigtable): auto-disable built-in Cloud Monitoring on custom endpoints and unauthenticated clients - #15294
Open
igorbernstein2 wants to merge 1 commit into
Open
igorbernstein2 wants to merge 1 commit into
igorbernstein2 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the initialization and enablement logic for built-in Cloud Monitoring metrics in the Bigtable client. It introduces helper methods to validate standard Bigtable endpoints and universe domains, ensuring built-in metrics are only enabled under appropriate configurations. Comprehensive unit tests are added to cover these edge cases. A review comment identifies a potential NullPointerException in MetricsImpl.java where a null check on userTracerFactory was omitted during refactoring.
igorbernstein2
force-pushed
the
fix/bigtable-metrics-endpoint-guard
branch
2 times, most recently
from
November 30, 2026 22:40
6f66d7c to
42e9ab4
Compare
igorbernstein2
commented
Dec 1, 2026
nimf
requested changes
Dec 2, 2026
Contributor
|
oh, also, AFAIK, release notes won't be picked up from PR description. If we need release notes for this, it has to be in a commit. |
mutianf
reviewed
Dec 3, 2026
mutianf
reviewed
Dec 3, 2026
mutianf
approved these changes
Dec 3, 2026
… endpoints and unauthenticated clients
igorbernstein2
force-pushed
the
fix/bigtable-metrics-endpoint-guard
branch
from
December 3, 2026 20:20
025fb15 to
4050867
Compare
igorbernstein2
enabled auto-merge (squash)
December 3, 2026 20:57
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.
Behavior Change (Release Notes)
User-visible behavior change for regional (REP), named PSC, and Private/Restricted VIP endpoints: Previously, clients in
googleapis.comconfigured with a regional endpoint (*.rep.googleapis.com), named Private Service Connect endpoint (*.p.googleapis.com), orprivate.googleapis.com/restricted.googleapis.comexported built-in Cloud Monitoring metrics to globalmonitoring.googleapis.com:443by default. With this change, built-in Cloud Monitoring export is automatically disabled (with aWARNINGlog) for those endpoints unless a Cloud Monitoring endpoint is explicitly configured viasetMetricsEndpoint(...).Problem
setEndpoint("bigtable.<universe>:443")without settinguniverseDomainorGOOGLE_CLOUD_UNIVERSE_DOMAIN, a regional endpoint*.rep.<universe>, a named PSC endpoint*.p.<universe>,private.<universe>/restricted.<universe>, or a proxy/emulator endpoint) and no explicitmetricsEndpoint, default-on built-in Cloud Monitoring export still uses the defaultedgoogleapis.comuniverse domain and dialsmonitoring.googleapis.com:443with the client's credentials and telemetry.NoCredentialsProvider(and no explicitmetricsEndpointor legacy metrics credential override), built-in Cloud Monitoring export still sends unauthenticated telemetry tomonitoring.googleapis.com:443.Solution
BigtableClientContext: Gate built-in Cloud Monitoring (builtinOtel) initialization onshouldEnableBuiltinMetrics(settings, credentials):!settings.areInternalMetricsEnabled().settings.getMetricsEndpoint()or-Dbigtable.test-monitoring-endpointoverride is set.FINE) when effective metrics credentials arenull(NoCredentialsProvider) and no explicit metrics endpoint is set.settings.getEndpoint()is a valid port-443 (or omitted-port) subdomain ofsettings.getUniverseDomain(), excluding regional endpoints (*.rep.<universeDomain>), named PSC endpoints (*.p.<universeDomain>), and Private/Restricted Google Access VIPs (private.<universeDomain>,restricted.<universeDomain>). Otherwise, built-in Cloud Monitoring export is disabled with a targetedWARNINGlog:setUniverseDomain()/GOOGLE_CLOUD_UNIVERSE_DOMAINorsetMetricsEndpoint(...).private/restricted: explains default export is not supported for that endpoint type and suggestssetMetricsEndpoint(...).settings.getEndpoint()reflects custom endpoints set onInstantiatingGrpcChannelProvider, but opaqueTransportChannelProviders (e.g.,FixedTransportChannelProviderwrapping a prebuilt channel) cannot be inspected and remain enabled.CustomOpenTelemetryMetricsProvider(userOtel) is unaffected.BigtableCloudMonitoringExporter: Expose@InternalApi getMonitoringEndpointOverride()and ignore blank endpoint overrides consistently.Testing
fmt-maven-plugin:format.BigtableClientContextTestandBigtableCloudMonitoringExporter2Testin JUnit 5 covering same-universe subdomains, cross-universe/TPC, REP, named PSC,private/restricted(including targeted remediation warnings), malformed/non-443 endpoints,InstantiatingGrpcChannelProvidercustom endpoints,NoCredentialsProvider, explicitmetricsEndpoint,disableInternalMetrics(),toBuilder()re-evaluation, andCustomOpenTelemetryMetricsProviderisolation.