Skip to content

fix(logging): honor universe_domain in HTTP transport - #19173

Merged
daniel-sanche merged 3 commits into
mainfrom
b588886740_universe_domain_http
Nov 22, 2026
Merged

daniel-sanche merged 3 commits into
mainfrom
b588886740_universe_domain_http

Conversation

@daniel-sanche

Copy link
Copy Markdown
Contributor

Summary

google.cloud.logging_v2.Client forwarded client_options to the GAPIC client in gRPC mode, but its HTTP Connection hardcoded https://logging.googleapis.com unless client_options.api_endpoint was explicitly provided—ignoring both client_options.universe_domain and the GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable.

Changes

  • Resolve Client.universe_domain via google.api_core.universe.determine_domain()
  • Update Connection in google.cloud.logging_v2._http to derive API_BASE_URL from https://logging.{universe_domain} when api_endpoint is not explicitly overridden

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for universe domains in the Google Cloud Logging Python client. It updates the Client class to determine and store the universe domain from client options or the GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable, and modifies the Connection class to construct the API endpoint dynamically based on this domain. Comprehensive unit tests have been added to verify this behavior, including precedence rules and error handling. The review feedback points out a potential issue in _http.py where getattr might return None or an empty string if the attribute is explicitly set to those values, and suggests using a safer fallback pattern to ensure DEFAULT_UNIVERSE is used.

@daniel-sanche
daniel-sanche marked this pull request as ready for review November 21, 2026 22:23
@daniel-sanche
daniel-sanche requested a review from a team as a code owner November 21, 2026 22:23

@coryan coryan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing obviously bad jumps at me. Looks like we have the right tests too. But I am terrible at Python (and at many other languages).

@daniel-sanche
daniel-sanche merged commit 1663b4b into main Nov 22, 2026
83 checks passed
@daniel-sanche
daniel-sanche deleted the b588886740_universe_domain_http branch November 22, 2026 00:01
daniel-sanche pushed a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.17.1](google-cloud-logging-v3.17.0...google-cloud-logging-v3.17.1)
(2026-11-22)


### Bug Fixes

* **logging:** honor universe_domain in HTTP transport
([#19173](#19173))
([1663b4b](1663b4b))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants