-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve proxy logging #58
Conversation
Log messagepack data as JSON
FP-1277 Serialize proxy messages as JSON when debug printing
Instead of the messagepack encoding as binary |
?send_err, | ||
"unable to send response message to outgoing channel" | ||
), | ||
if let Err(err) = task.reply.send(response_message) { |
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.
Should we perhaps use the log_err()
style logging stuff you introduced in api
?
#[instrument(err, skip_all, fields( | ||
trace_id = ?message.op_id, | ||
data_source_name = ?message.data_source_name, | ||
message.data = %msgpack_to_json(&message.data)? |
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.
Does this actually unpack the Result
from msgpack_to_json
? I was under the impression the syntax for the instrument macro accepted ?
both before and after the variable/data to print it as debug, not necessarily do error unwrapping.
Furthermore even if that's how it works shouldn't we just swallow the errors? We don't want to prevent the actual code from running if something broke in the serde transcode that's only used for logging.
f.debug_struct("InvokeProxyMessage") | ||
.field("op_id", &self.op_id) | ||
.field("data_source_name", &self.data_source_name) | ||
.field("data", &format!("[{} bytes]", self.data.len())) |
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.
Couldn't we just add in the msgpack_to_json
here and keep most of our existing code?
Resolves FP-1277