-
Notifications
You must be signed in to change notification settings - Fork 678
iceberg: couple logging improvements #27715
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
It's very verbose as is.
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.
Pull Request Overview
This PR improves logging in the Iceberg REST client for better debugging and operational visibility. The changes add trace-level logging for failed REST requests and throttle frequent warning messages about default partition specs with AWS Glue.
- Added trace-level logging with request payloads when REST client operations fail
- Implemented rate limiting for AWS Glue default partition spec warnings to reduce log noise
- Enhanced error diagnostics by logging request details on failure
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/v/iceberg/rest_client/catalog_client.cc | Added trace logging for failed requests with payloads and improved error handling structure |
src/v/iceberg/rest_client/BUILD | Added dependency on iobuf_parser for payload logging functionality |
src/v/datalake/coordinator/coordinator.cc | Implemented rate limiting for AWS Glue partition spec warning messages |
template<typename T> | ||
void maybe_log_payload_as_json( | ||
ss::logger& l, ss::log_level lvl, std::string_view msg, const T& payload) { | ||
if (!l.is_enabled(lvl)) { | ||
return; | ||
} | ||
auto buf = serialize_payload_as_json(payload); | ||
iobuf_parser p(std::move(buf)); | ||
vlogl(iceberg::log, lvl, "{}: {}", msg, p.read_string_safe(4_KiB)); | ||
} |
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.
This function should have a docstring explaining its purpose, parameters, and the 4_KiB limit rationale. It's unclear why 4_KiB was chosen as the safe read limit for payload logging.
Copilot uses AI. Check for mistakes.
} | ||
auto buf = serialize_payload_as_json(payload); | ||
iobuf_parser p(std::move(buf)); | ||
vlogl(iceberg::log, lvl, "{}: {}", msg, p.read_string_safe(4_KiB)); |
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.
The 4_KiB limit should be defined as a named constant instead of a magic number. Consider defining it as constexpr auto max_payload_log_size = 4_KiB;
at the top of the file.
Copilot uses AI. Check for mistakes.
232dda3
to
138231a
Compare
Force pushed a non-functional bug (s/iceberg::logger/l) |
Retry command for Build#72892please wait until all jobs are finished before running the slash command
|
When there is an error returned from the REST catalog, we have very little context about what we sent. This commit addresses this by logging the logical contents of the request as JSON. I considered logging at a lower level, and logging the entire HTTP request payload (e.g. in perform_request() after signing and such), but opted to place the at the callsite because the context we have there is already const and available to be logged conditionally (vs in perform_request(), the request is moved, making conditional logging trickier).
138231a
to
e315237
Compare
CI test resultstest results on build#72910
|
/backport v25.2.x |
/backport v25.1.x |
Failed to create a backport PR to v25.1.x branch. I tried:
|
Failed to create a backport PR to v25.2.x branch. I tried:
|
Backports Required
Release Notes
Improvements