logger.list_entries optimization using equals and docs update#1848
Merged
tseaver merged 2 commits intogoogleapis:masterfrom Jun 10, 2016
Merged
logger.list_entries optimization using equals and docs update#1848tseaver merged 2 commits intogoogleapis:masterfrom
tseaver merged 2 commits intogoogleapis:masterfrom
Conversation
Contributor
|
I suppose I should let @tseaver take the lead here |
docs/logging-usage.rst
Outdated
| ... "robots-pubsub", | ||
| ... filter='log:apache-access AND textPayload:robot') | ||
| >>> sink.pubsub_topic = 'projects/my-project/topics/my-topic' | ||
| ... 'log:apache-access AND textPayload:robot', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
logName in the v2 API expects the fully qualified name. The colon operator is “contains” so it works since the fully qualified name contains itself, but it is not indexed and can be extremely slow.
Contributor
Author
|
Ok, addressed all review comments, changed commit messages/PR name to reflect that logging changes are optimizations rather then bugfixes,assuming Travis passes it's ready for another pass. |
Contributor
|
@waprin Thanks for the research, as well as the patch! |
This was referenced Jun 15, 2016
parthea
pushed a commit
that referenced
this pull request
Nov 26, 2025
… the MWID/X.509 cert sources detected (#1848) The Python SDK will use a hybrid approach for mTLS enablement: - If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is set (either true or false), the SDK will respect that setting. This is necessary for test scenarios and users who need to explicitly control mTLS behavior. - If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not set, the SDK will automatically enable mTLS only if it detects Managed Workload Identity (MWID) or X.509 Workforce Identity Federation (WIF) certificate sources. In other cases where the variable is not set, mTLS will remain disabled. ** This change also adds the helper method `check_use_client_cert` and it's unit test, which will be used for checking the criteria for setting the mTLS to true ** This change is only for Auth-Library, other changes will be created for Client-Library use-cases. --------- Signed-off-by: Radhika Agrawal <agrawalradhika@google.com> Co-authored-by: Daniel Sanche <d.sanche14@gmail.com>
parthea
pushed a commit
that referenced
this pull request
Nov 26, 2025
… enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert sources detected (#1859) Add public wrapper for check_use_client_cert which enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert sources detected. Also, fix check_use_client_cert to return boolean value. Change #1848 added the check_use_client_cert method that helps know if client cert should be used for mTLS connection. However, that was in a private class, thus, created a public wrapper of the same function so that it can be used by python Client Libraries. Also, updated check_use_client_cert to return a boolean value instead of existing string value for better readability and future scope. --------- Signed-off-by: Radhika Agrawal <agrawalradhika@google.com> Co-authored-by: Daniel Sanche <d.sanche14@gmail.com>
parthea
pushed a commit
that referenced
this pull request
Nov 26, 2025
Librarian Version: v0.5.0 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator:latest <details><summary>google-auth: 2.43.0</summary> ## [2.43.0](googleapis/google-auth-library-python@v2.42.1...v2.43.0) (2025-11-05) ### Features * Add public wrapper for _mtls_helper.check_use_client_cert which enables mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert sources detected (#1859) ([1535eccb](googleapis/google-auth-library-python@1535eccb)) * Enable mTLS if GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, if the MWID/X.509 cert sources detected (#1848) ([395e405b](googleapis/google-auth-library-python@395e405b)) * onboard `google-auth` to librarian (#1838) ([c503eaa5](googleapis/google-auth-library-python@c503eaa5)) </details>
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.
Two changes here:
logger.list_entries() was using just the logger name rather than the fully qualified name, you can see an example on the docs that from v1 to v2 the change from log to logName also changed to expect fully qualified name.
The query was also using the colon operator, which is a "has" operator. Problem 1 is that this is a slower query because it's not indexed, problem 2 is that I'm pretty sure there's a bug because it's not working.
Second set of changes is the docs, just some random small discrepancies between them and the actual API. The biggest discrepancy was in the Sink constructor, the samples all use keyword arguments and special names for different sink types, the actual code seems to take these all as general positional arguments.