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

p2p: add stream counter metric #2278

Merged
merged 8 commits into from
Jun 6, 2023
Merged

Conversation

gsora
Copy link
Collaborator

@gsora gsora commented Jun 5, 2023

Adds a Prometheus metric to track the opened streams by protocol.

category: bug
ticket: #2277

gsora added 2 commits June 5, 2023 13:41
Create a closure with the blocking ping logic so that it's easier to understand and defer ping stream context's.
Adds `peer_streams` gauge with the following description: ""Current number of libp2p streams by peer and direction ('inbound' or 'outbound' or 'unknown').".
@gsora gsora requested review from corverroos and dB2510 June 5, 2023 11:43
p2p/ping.go Outdated Show resolved Hide resolved
Copy link
Contributor

@xenowits xenowits left a comment

Choose a reason for hiding this comment

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

LGTM!

p2p/ping.go Outdated Show resolved Hide resolved
p2p/ping.go Outdated Show resolved Hide resolved
@gsora gsora changed the title p2p: simplify pingPeerOnce logic p2p: add stream counter metric Jun 5, 2023
@gsora gsora requested review from corverroos and xenowits June 5, 2023 13:46
@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.08 ⚠️

Comparison is base (0f2b40f) 53.80% compared to head (48525b3) 53.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2278      +/-   ##
==========================================
- Coverage   53.80%   53.72%   -0.08%     
==========================================
  Files         188      188              
  Lines       25542    25563      +21     
==========================================
- Hits        13742    13733       -9     
- Misses      10113    10145      +32     
+ Partials     1687     1685       -2     
Impacted Files Coverage Δ
p2p/metrics.go 0.00% <ø> (ø)
p2p/p2p.go 20.75% <0.00%> (-1.79%) ⬇️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

p2p/metrics.go Show resolved Hide resolved
p2p/p2p.go Outdated Show resolved Hide resolved
p2p/p2p.go Outdated Show resolved Hide resolved
gsora added 2 commits June 5, 2023 16:55
Don't need in prod, we're going to remove them once we fix the steam leak issue
@dB2510 dB2510 added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jun 6, 2023
@obol-bulldozer obol-bulldozer bot merged commit 3e16a08 into main Jun 6, 2023
12 checks passed
@obol-bulldozer obol-bulldozer bot deleted the fix/ping_stream_recycle branch June 6, 2023 06:10
corverroos pushed a commit that referenced this pull request Jun 8, 2023
Adds a Prometheus metric to track the opened streams by protocol.

category: bug
ticket: #2277
obol-bulldozer bot pushed a commit that referenced this pull request Jun 8, 2023
Cherry picks the following PRs from main:
- #2278 
- #2289 
- #2290 

category: bug
ticket: #2277
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants