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

network/discovery: rate limit skipped peers log #1803

Open
wants to merge 5 commits into
base: stage
Choose a base branch
from

Conversation

nkryuchkov
Copy link
Contributor

@zktaiga reported that this log makes up to 40% of stage logs

metricSkippedPeers = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "ssv:network:discovery:skipped_peers",
Help: "Counts skipped peers",
}, []string{"enr", "peer_id", "err"})
Copy link
Contributor

Choose a reason for hiding this comment

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

Having peer ID or an ENR as a label is problematic because of its high cardinality (Prometheus struggles with this). We could use something such as ssv:network:discovery:skipped_peers_total for now if a total count would help. If not, we need some other solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zktaiga reverted the change and added the log rate limit

@nkryuchkov nkryuchkov changed the title network/discovery: replace skipped peers log with metric network/discovery: rate limit skipped peers log Oct 19, 2024
y0sher
y0sher previously approved these changes Oct 20, 2024
Copy link
Contributor

@y0sher y0sher left a comment

Choose a reason for hiding this comment

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

this should reduce logs but also not miss unique logs. good job

@y0sher y0sher dismissed their stale review October 21, 2024 11:16

cache is never cleaned

@moshe-blox
Copy link
Contributor

moshe-blox commented Oct 21, 2024

this looks good, but the map will never clean and may grow infinitely

instead of implementing cleanup, i suggest just using https://github.com/jellydator/ttlcache instead (because we already import it)

Copy link
Contributor

@y0sher y0sher left a comment

Choose a reason for hiding this comment

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

clean the cache, maybe use some existing ttl cache like @moshe-blox suggested

@nkryuchkov
Copy link
Contributor Author

@y0sher @moshe-blox I heard from @zktaiga we decided not to proceed with this solution, so can I close this?

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