feat: add client debug logging support for server side streaming REST calls#2340
Merged
feat: add client debug logging support for server side streaming REST calls#2340
Conversation
564342c to
5648ab2
Compare
5648ab2 to
6478506
Compare
ohmayr
approved these changes
Apr 3, 2025
vchudnov-g
reviewed
Apr 3, 2025
gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2
Outdated
Show resolved
Hide resolved
| {# TODO(https://github.com/googleapis/gapic-generator-python/issues/2279): Add logging support for rest streaming. #} | ||
| {% if not method.server_streaming %} | ||
| if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER | ||
| {# Logging of the streaming response payload is in `google-api-core` because the response #} |
Contributor
There was a problem hiding this comment.
Depending how we want to log (a) receiving a streaming response vs (b) exposing the next streamed item to the user, we could possibly want to log something here
(a) should always happen in api-core
(b) could happen in api-core, or it could happen here when we iterate to the next streamed item that was previously received.
Ditto for async
Contributor
Author
There was a problem hiding this comment.
I filed #2389 to follow up on this and I also captured this comment in the code.
…ce/transports/rest.py.j2 Co-authored-by: Victor Chudnovsky <[email protected]>
Contributor
Author
|
Client side streaming is not yet supported in REST transport (See #2279) |
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 #2279
Also see necessary changes in googleapis/python-api-core#794 to add logging in the response iterator each time a chunk is received in the stream.
Sync Unary->Stream
Async Unary->Stream