Skip to content
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

Merged
merged 8 commits into from
Feb 11, 2022
Merged

Improve proxy logging #58

merged 8 commits into from
Feb 11, 2022

Conversation

emschwartz
Copy link
Contributor

@emschwartz emschwartz commented Feb 10, 2022

  • Update fp-bindgen-support
  • Clean up proxy logging
  • Fix proxy connecting to relay in Tilt
  • Log health check response codes
  • Don't print binary data

Resolves FP-1277

@emschwartz emschwartz requested a review from a team as a code owner February 10, 2022 16:10
@linear
Copy link

linear bot commented Feb 10, 2022

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) {
Copy link
Contributor

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)?
Copy link
Contributor

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()))
Copy link
Contributor

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?

@emschwartz emschwartz merged commit 94a8950 into main Feb 11, 2022
@emschwartz emschwartz deleted the proxy-debug-logging branch February 11, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants