-
Notifications
You must be signed in to change notification settings - Fork 721
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 structured logging for TraceSendRecv TxSubmission objects #584
Conversation
15c8c7c
to
179ee61
Compare
toObject _verb (MsgRequestTxIds _ _ _) = | ||
mkObject | ||
[ "kind" .= String "MsgRequestTxIds" | ||
] | ||
toObject _verb (MsgReplyTxIds _) = | ||
mkObject | ||
[ "kind" .= String "MsgReplyTxIds" | ||
] | ||
toObject _verb MsgDone = | ||
mkObject | ||
[ "kind" .= String "MsgDone" | ||
] |
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.
Is this going to be too noisy being logged at info?
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.
if these messages are useful to see in production then "Info" is right.
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.
Just a note: since MsgRequestTxs
and MsgReplyTxs
are the only useful constructors to log right now, I added a transformer in Cardano.Tracing.Tracers
(see traceMsgRequestAndReplyTxs
) to ensure that those are the only ones that are traced.
@@ -195,7 +195,7 @@ mkTracers traceOptions tracer = do | |||
, consensusTracers | |||
= mkConsensusTracers forgeTracers traceOptions | |||
, protocolTracers | |||
= mkProtocolsTracers traceOptions | |||
= mkProtocolTracers traceOptions |
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.
👍
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.
👍
toObject _verb (MsgRequestTxIds _ _ _) = | ||
mkObject | ||
[ "kind" .= String "MsgRequestTxIds" | ||
] | ||
toObject _verb (MsgReplyTxIds _) = | ||
mkObject | ||
[ "kind" .= String "MsgReplyTxIds" | ||
] | ||
toObject _verb MsgDone = | ||
mkObject | ||
[ "kind" .= String "MsgDone" | ||
] |
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.
if these messages are useful to see in production then "Info" is right.
0aef763
to
a0ec6de
Compare
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.
LGTM!
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.
I'm a little nervous about putting this into the low level protocol tracer. It is quite a high volume tracer. I'd be happier if we could do this in the tracer for the higher level "Inbound" and "Outbound" client & server implementations. This lets us be more precise about logging just the things we need, rather than every single message (and having to filter most of it out).
We already have a TraceTxSubmissionInbound
and a TraceTxSubmissionOutbound
.
So for our requirement:
We also need to trace at the default log level for the outbound side of tx submission:
- when a remote peer has requested a tx id, and we do send the tx to them, then we should log that the txid was requested and sent
I think we can do it just by extending the TraceTxSubmissionOutbound
with the right thing and using it in the right place, and tracing that at default log level.
a0ec6de
to
1e029a0
Compare
Although this PR is no longer related to #527, it still adds structured logging for |
bors r+ |
584: Add structured logging for TraceSendRecv TxSubmission objects r=intricate a=intricate Co-authored-by: Luke Nadur <[email protected]>
Build succeeded |
1688: Trace transaction requests and replies in txSubmissionOutbound r=intricate a=intricate Related to IntersectMBO/cardano-node#527. More specifically, see IntersectMBO/cardano-node#584 (review). Co-authored-by: Luke Nadur <[email protected]>
624: Implement ToObject instance for TraceTxSubmissionOutbound r=intricate a=intricate Closes #527 See #584 (review) Co-authored-by: Luke Nadur <[email protected]>
No description provided.