-
Notifications
You must be signed in to change notification settings - Fork 84
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
cmd/relay: enabled new libp2p relay metrics #3040
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3040 +/- ##
==========================================
+ Coverage 54.76% 54.88% +0.11%
==========================================
Files 207 207
Lines 28932 28935 +3
==========================================
+ Hits 15844 15880 +36
+ Misses 11267 11236 -31
+ Partials 1821 1819 -2 ☔ View full report in Codecov by Sentry. |
This reverts commit 964e32c.
Quality Gate passedIssues Measures |
} | ||
|
||
p2p.RegisterConnectionLogger(ctx, tcpNode, nil) | ||
|
||
labels := map[string]string{"relay_peer": p2p.PeerName(tcpNode.ID())} | ||
log.SetLokiLabels(labels) | ||
promRegistry, err := promauto.NewRegistry(labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it a bit weird creating a prometheus registry in startP2P
function? Does it make sense to create it outside of it (in cmd/relay/relay.go:Run
afaict) and pass it as an argument, similarly to how the reporter is passed (another monitoring structure)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is in the dependency on labels
which we can populate only after we started a tcpNode.
I would rework it in a different way to remove this dependency, but would be a drastic change, not for the scope of this PR for sure.
libp2p introduced set of new metrics for relay:
https://github.com/libp2p/go-libp2p/blob/master/p2p/protocol/circuitv2/relay/metrics.go
This work integrates these metrics into our instrumentation flow.
Note: metrics reported by libp2p will be prefixed:
libp2p_relaysvc
whereas metrics reported by charon code are prefixed:relay_p2p
. This distinction seems useful for clear separation and avoiding clashes. Therefore,metrics.md
remains intact. This only enriches libp2p metrics with charon cluster labels.category: feature
ticket: #2544