-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add detailed CRT metrics and tweak per-request logging #390
Conversation
This change is a few related things to make logging more useful: - Include verbose CRT request metrics at trace level. We emit what we think is the "interesting" stuff at higher levels, but for detailed investigation we might want to see the raw CRT view. - Add parameters to request spans. This ensures that we know _which_ request is going wrong when we see log messages about requests. Signed-off-by: James Bornholt <bornholt@amazon.com>
1fcb834
to
f75a836
Compare
Signed-off-by: James Bornholt <bornholt@amazon.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.
Great QOL logging improvement!
One possible query, otherwise LGTM.
.ok_or_last_error() | ||
.ok()? | ||
}; | ||
assert!(!out.is_null(), "IP address should be available if call succeeded"); |
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 this be debug assert, and return None
for release builds?
assert!(!out.is_null(), "IP address should be available if call succeeded"); | |
if (out.is_null()) { | |
debug_panic!("IP address should not be null if call succeeded"); | |
return None; | |
} |
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 CRT's API is a bit inconsistent here: of the getters that can fail, only some return errors, others just silently don't do anything. For the ones that return errors (like this one does), I don't think we should try to recover if the CRT violated its contract.
Description of change
This change is a few related things to make logging more useful:
think is the "interesting" stuff at higher levels, but for detailed
investigation we might want to see the raw CRT view.
request is going wrong when we see log messages about requests.
Does this change impact existing behavior?
No, logging only.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).