Skip to content

fix(libp2p): stop dialer hosts from overwriting rcmgr metrics - #5687

Open
gacevicljubisa wants to merge 1 commit into
masterfrom
fix/rcmgr-dialer-metrics
Open

gacevicljubisa wants to merge 1 commit into
masterfrom
fix/rcmgr-dialer-metrics

Conversation

@gacevicljubisa

Copy link
Copy Markdown
Member

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have added or updated fuzz targets for any code handling untrusted input.
  • I have filled out the description and linked the related issues.

Description

The autonat dialer and ping dialer hosts were created without a resource manager, so go-libp2p gave each one its default resource manager with metrics enabled. The go-libp2p stats reporter writes to package-level Prometheus collectors, so these two hosts overwrote the main host's libp2p_rcmgr_* gauges: connections, fds and streams flapped between the real value and 0 on every scrape, and libp2p_rcmgr_limit showed go-libp2p's autoscaled defaults instead of Bee's stream limits.

The dialer hosts now get a resource manager with the same default limits but metrics disabled. The main host is unchanged. The new test asserts the libp2p_rcmgr_limit system gauges carry the main host's limits.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

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.

2 participants