-
Notifications
You must be signed in to change notification settings - Fork 18
Access Log improved for common Istio operators #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
REQUESTED_SERVER_NAME, UPSTREAM_TRANSPORT_FAILURE_REASON, RESPONSE_CODE_DETAILS, and CONNECTION_TERMINATION_DETAILS. Specifically, perform the following refactorings: - Track upstream transport errors in FinishContext and access logs - Refactor error handling to propagate EventKind/Error through SyntheticHttpResponse - Update BodyWithMetrics to pass EventError to completion callback - Simplify Context trait implementations using map_or - Move EventError from retry_policy to event_error module - Update synthetic response constructors to accept EventKind/EventError - Pass upstream_failure to access log contexts in TCP and HTTP handlers - Add response_code_details to FinishContext - Include ConnectionTerminationDetails in FinishContext, access logs, and log formatting - Apply other minor improvements and bug fixes Signed-off-by: Nicola Bonelli <nicola.bonelli@huawei-partners.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @awgn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances the access logging capabilities by introducing several new operators that provide more detailed insights into request processing, upstream failures, and connection terminations. It centralizes error handling logic into a dedicated module, allowing for a more structured and informative propagation of event-specific errors throughout the system. These changes collectively aim to provide richer, more actionable data for monitoring and troubleshooting, particularly beneficial for operators managing services with Istio.
Highlights
- Enhanced Access Log Operators: Enabled new access log operators including ROUTE_NAME, REQUESTED_SERVER_NAME, UPSTREAM_TRANSPORT_FAILURE_REASON, RESPONSE_CODE_DETAILS, and CONNECTION_TERMINATION_DETAILS to provide more granular and comprehensive logging for Istio operators.
- Refactored Error Handling: Introduced a new
event_errormodule to centralizeEventErrorandEventKinddefinitions, improving error propagation and allowing for more specific error details to be captured in access logs and synthetic responses. - Improved Contextual Information: Updated various context structs (
FinishContext,UpstreamContext,DownstreamContext,InitHttpContext) to include new fields likeupstream_failure,response_code_details,connection_termination_details,route_name, andserver_name, enriching the data available for logging and metrics. - Simplified Code with
map_or: RefactoredContexttrait implementations, particularly inTcpContextandDownstreamContext, to leveragemap_orfor more concise and idiomatic handling of optional values. - Updated Synthetic HTTP Responses: Modified
SyntheticHttpResponseconstructors to acceptEventKind, ensuring that internally generated responses carry specific event information for better debugging and logging.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
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 significant improvements to access logging by enabling several new Istio-compatible operators. The refactoring to propagate detailed error and event information via EventKind and SyntheticHttpResponse is well-executed and enhances observability. The code is also cleaner with the move of error-related logic to a dedicated event_error module and the consistent use of map_or for conciseness. I've found one potential issue with error chain traversal that should be addressed. Otherwise, this is a great set of changes.
Correct the logic to preserve each source level: avoid direct source recursion and unwrap the inner error instead. Signed-off-by: Nicola Bonelli <nicola.bonelli@huawei-partners.com>
Signed-off-by: Nicola Bonelli <nicola.bonelli@huawei-partners.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dawid-nowak The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
Enable the following access-log operators: ROUTE_NAME, REQUESTED_SERVER_NAME, UPSTREAM_TRANSPORT_FAILURE_REASON, RESPONSE_CODE_DETAILS, and CONNECTION_TERMINATION_DETAILS.
Specifically, perform the following refactoring: