-
Notifications
You must be signed in to change notification settings - Fork 2.7k
client/network/service: Add primary dimension to connection metrics #6472
Changes from 1 commit
68c4f31
2d2f93e
2ca29a8
b03b12d
9f3f33e
779a06e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -854,6 +854,8 @@ struct Metrics { | |||||
| // This list is ordered alphabetically | ||||||
| connections_closed_total: CounterVec<U64>, | ||||||
| connections_opened_total: CounterVec<U64>, | ||||||
| distinct_peers_connections_closed_total: CounterVec<U64>, | ||||||
| distinct_peers_connections_opened_total: CounterVec<U64>, | ||||||
| import_queue_blocks_submitted: Counter<U64>, | ||||||
| import_queue_finality_proofs_submitted: Counter<U64>, | ||||||
| import_queue_justifications_submitted: Counter<U64>, | ||||||
|
|
@@ -889,16 +891,30 @@ impl Metrics { | |||||
| connections_closed_total: register(CounterVec::new( | ||||||
| Opts::new( | ||||||
| "sub_libp2p_connections_closed_total", | ||||||
| "Total number of connections closed, by direction, reason and by being the first or not" | ||||||
| "Total number of connections closed, by direction and reason" | ||||||
| ), | ||||||
| &["direction", "reason", "was_first"] | ||||||
| &["direction", "reason"] | ||||||
| )?, registry)?, | ||||||
| connections_opened_total: register(CounterVec::new( | ||||||
| Opts::new( | ||||||
| "sub_libp2p_connections_opened_total", | ||||||
| "Total number of connections opened by direction and by being the first or not" | ||||||
| "Total number of connections opened by direction" | ||||||
| ), | ||||||
| &["direction", "is_first"] | ||||||
| &["direction"] | ||||||
| )?, registry)?, | ||||||
| distinct_peers_connections_closed_total: register(CounterVec::new( | ||||||
| Opts::new( | ||||||
| "sub_libp2p_distinct_peers_connections_closed_total", | ||||||
| "Total number of connections closed with distinct peers, by direction and reason" | ||||||
| ), | ||||||
| &["direction", "reason"] | ||||||
|
||||||
| &["direction", "reason"] |
I didn't think about it, but I don't think it makes sense to have the direction or reason on these metrics.
It would be misleading to report a single direction while we might have multiple connections with multiple directions.
Similarly, the reason here is the reason for closing the last connection, which to me makes the last connection special while it shouldn't be.
For instance, if a severe protocol error happens on the "main" connection, we immediately close it and also close all the other connections to that same peer afterwards. The reason reported here would be the one of the other connection (if any), which doesn't really make sense.
Outdated
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.
Same idea: remove the direction.
| distinct_peers_connections_opened_total: register(CounterVec::new( | |
| distinct_peers_connections_opened_total: register(Counter::new( |
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.