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

bug: waku_total_unique_peers metric wrong value #3245

Open
AlbertoSoutullo opened this issue Jan 17, 2025 · 5 comments
Open

bug: waku_total_unique_peers metric wrong value #3245

AlbertoSoutullo opened this issue Jan 17, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@AlbertoSoutullo
Copy link

Problem

Metric waku_total_unique_peers does not report correct information.

Impact

This leads to inconsistencies when trying to analyze Waku's behavior.

To reproduce

  1. Create a bootstrap node without relay
  2. Create 3 relay nodes and connect them through discv5 to the bootstrap node. Set them in the same shard.
  3. Check metrics

Expected behavior

Depending on the implementation, but waku_total_unique_peers should never report 5, as there are only 4 nodes in the network.

Screenshots/logs

If I enter to one node and do curl -X GET http://localhost:8645/admin/v1/peers I obtain:

[{"multiaddr":"/ip4/10.42.61.17/tcp/60000/p2p/16Uiu2HAmAHhKnrcw3kdP5VddyxLvHd331uepHshzJBSDGYMrqZp8","protocols":[{"protocol":"/vac/waku/relay/2.0.0","connected":true}],"origin":"Discv5"},
{"multiaddr":"/ip4/10.42.82.42/tcp/60000/p2p/16Uiu2HAmJsu1bPtcg4r1YpX28S3EKze5Tk23PP4jQhWtZt5Gdg8W","protocols":[{"protocol":"/vac/waku/relay/2.0.0","connected":true}],"origin":"Discv5"}]

But waku_total_unique_peers is reporting a value of 5.

nwaku version/commit hash

/usr/bin/wakunode --version
version / git commit hash: v0.34.0-rc.1
@AlbertoSoutullo AlbertoSoutullo added the bug Something isn't working label Jan 17, 2025
@NagyZoltanPeter
Copy link
Contributor

Hm, pretty strange as the metric exclude self and already managed peers.
The only problem I found that it does not follow disconnects, thus adding a peer, disconnet and re-connect will count one peer twice - my unvalidated assumption.

@NagyZoltanPeter NagyZoltanPeter moved this to To Do in Waku Jan 17, 2025
@AlbertoSoutullo
Copy link
Author

Hm, pretty strange as the metric exclude self and already managed peers. The only problem I found that it does not follow disconnects, thus adding a peer, disconnet and re-connect will count one peer twice - my unvalidated assumption.

In my case, there were no disconnections.

@NagyZoltanPeter
Copy link
Contributor

Hm, pretty strange as the metric exclude self and already managed peers. The only problem I found that it does not follow disconnects, thus adding a peer, disconnet and re-connect will count one peer twice - my unvalidated assumption.

In my case, there were no disconnections.

Hm, which dashboard do you use exactly, or how is your exact config?
It would be interesting to see the panel code that accumulates that particular metric.

@AlbertoSoutullo
Copy link
Author

Hm, pretty strange as the metric exclude self and already managed peers. The only problem I found that it does not follow disconnects, thus adding a peer, disconnet and re-connect will count one peer twice - my unvalidated assumption.

In my case, there were no disconnections.

Hm, which dashboard do you use exactly, or how is your exact config? It would be interesting to see the panel code that accumulates that particular metric.

I did it locally. I am just quering that metric for a single node. It's not like I am aggregating or summing or anything. The value is directly reported by the waku node.

@NagyZoltanPeter
Copy link
Contributor

Hm, pretty strange as the metric exclude self and already managed peers. The only problem I found that it does not follow disconnects, thus adding a peer, disconnet and re-connect will count one peer twice - my unvalidated assumption.

In my case, there were no disconnections.

Hm, which dashboard do you use exactly, or how is your exact config? It would be interesting to see the panel code that accumulates that particular metric.

I did it locally. I am just quering that metric for a single node. It's not like I am aggregating or summing or anything. The value is directly reported by the waku node.

Thank you.
It is even interesting there, due without disconnect it can only show the connected peers without self.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To Do
Development

No branches or pull requests

2 participants