feat: add debug log when sending requests via REST#2270
Merged
Conversation
afb6631 to
fb771fa
Compare
ohmayr
reviewed
Dec 3, 2024
gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2
Outdated
Show resolved
Hide resolved
vchudnov-g
reviewed
Dec 5, 2024
Contributor
vchudnov-g
left a comment
There was a problem hiding this comment.
(These comments didn't get posted yesterday)
gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2
Show resolved
Hide resolved
gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2
Show resolved
Hide resolved
vchudnov-g
reviewed
Dec 5, 2024
| if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER | ||
| http_response = { | ||
| "payload": {% if method.output.ident.is_proto_plus_type %}{{ method.output.ident }}.to_json(resp){% else %}json_format.MessageToJson(resp){% endif %}, | ||
| "status": "OK", # need to obtain this properly |
Contributor
There was a problem hiding this comment.
Need to figure out how to obtain this.
Contributor
There was a problem hiding this comment.
Thanks! This is the correct REST status code? (i.e. we don't translate it to gRPC?)
Contributor
There was a problem hiding this comment.
we don't translate it to gRPC?
What does that mean?
Contributor
There was a problem hiding this comment.
We can confirm the status code from the logs that I've shared in our chat.
gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2
Show resolved
Hide resolved
gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2
Show resolved
Hide resolved
vchudnov-g
approved these changes
Dec 6, 2024
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 b/381100800
The work in #2266 (comment) is still outstanding.
When running tests for async REST, I see the following stack trace. If this is expected, we should file a follow up issue in case one doesn't already exist.
using this code