Skip to content

feat: enhance Sync logs and metrics #3370

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

Merged
merged 6 commits into from
Apr 16, 2025
Merged

feat: enhance Sync logs and metrics #3370

merged 6 commits into from
Apr 16, 2025

Conversation

SionoiS
Copy link
Contributor

@SionoiS SionoiS commented Apr 11, 2025

Description

I added the remote peer id to most logs so that it's easier to know which connection failed.

Also, added metrics for differences found.

@SionoiS SionoiS requested review from jm-clius and a team April 11, 2025 14:27
@SionoiS SionoiS self-assigned this Apr 11, 2025
@SionoiS SionoiS changed the title feat: add remote peer id to logs feat: add remote peer id to sync logs Apr 11, 2025
Copy link

github-actions bot commented Apr 11, 2025

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3370

Built from 8b2c1f8

@SionoiS SionoiS changed the title feat: add remote peer id to sync logs feat: enhance Sync logs and metrics Apr 11, 2025
Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for it! 💯
Just added some nitpick comments that I hope you find useful

return err("connection write error: " & writeRes.error.msg)
await connection.close()
return err(
"remote " & $connection.peerId & " connection write error: " & writeRes.error.msg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to differentiate it a little from the other:

Suggested change
"remote " & $connection.peerId & " connection write error: " & writeRes.error.msg
"remote " & $connection.peerId & " connection write error initiate: " & writeRes.error.msg

@@ -217,7 +229,7 @@ proc storeSynchronization*(
let connOpt = await self.peerManager.dialPeer(peer, WakuReconciliationCodec)

let conn: Connection = connOpt.valueOr:
return err("cannot establish sync connection")
return err("fail to dial remote " & $peer.peerId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?

Suggested change
return err("fail to dial remote " & $peer.peerId)
return err("fail to dial remote " & $peer.peerId & " store sync conn error: " & $error)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an Option there's no error to log sadly.

@@ -69,7 +70,7 @@ proc openConnection(
let connOpt = await self.peerManager.dialPeer(peerId, WakuTransferCodec)

let conn: Connection = connOpt.valueOr:
return err("Cannot establish transfer connection")
return err("fail to dial remote " & $peerId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe :)?

Suggested change
return err("fail to dial remote " & $peerId)
return err("fail to dial remote " & $peerId & " open conn error: " & $error)

@SionoiS SionoiS merged commit f6c680a into master Apr 16, 2025
13 checks passed
@SionoiS SionoiS deleted the feat--enhance-sync-logs branch April 16, 2025 13:24
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.

4 participants