-
Notifications
You must be signed in to change notification settings - Fork 964
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
feat(swarm): expose ConnectionId
and add conn duration metric
#3927
Conversation
…metric - Exposes the `ConnectionId` in the various `SwarmEvent` variants. - Tracks connection duration in `libp2p-metrics::swarm`.
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.
Direction looks good.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This pull request has merge conflicts. Could you please resolve them @mxinden? 🙏 |
misc/metrics/src/swarm.rs
Outdated
#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)] | ||
struct ConnectionClosedLabels { | ||
role: Role, | ||
protocols: String, | ||
// TODO: Should be Option<ConnectionError>. Needs https://github.com/prometheus/client_rust/pull/137 |
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.
Do we wait for this before merging here?
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.
Oversight. Fixed with 9578315. Thanks for the catch Thomas!
ConnectionId
thus enable connection duration metricConnectionId
and add conn duration metric
- Exposes the `ConnectionId` in the various `SwarmEvent` variants. - Tracks connection duration in `libp2p-metrics::swarm`. Pull-Request: libp2p#3927.
Description
ConnectionId
in the variousSwarmEvent
variants.libp2p-metrics::swarm
.Notes & open questions
Draft as it depends on prometheus/client_rust#137.Change checklist