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

near_network_routed_msg_hops metric not properly collected #10311

Open
saketh-are opened this issue Dec 8, 2023 · 0 comments
Open

near_network_routed_msg_hops metric not properly collected #10311

saketh-are opened this issue Dec 8, 2023 · 0 comments
Labels
A-network Area: Network C-good-first-issue Category: issues that are self-contained and easy for newcomers to work on. T-core Team: issues relevant to the core team

Comments

@saketh-are
Copy link
Collaborator

This metric is supposed to produce counts of received network messages, bucketed by the message type as well as the number of hops traversed by the message.

// The routed message reached its destination. If the number of hops is known, then update the
// corresponding metric.
fn record_routed_msg_hops(msg: &RoutedMessageV2) {
const MAX_NUM_HOPS: i32 = 20;
// We assume that the number of hops is small.
// As long as the number of hops is below 10, this metric will not consume too much memory.
if let Some(num_hops) = msg.num_hops {
if num_hops >= 0 {
let num_hops = if num_hops > MAX_NUM_HOPS { MAX_NUM_HOPS } else { num_hops };
NETWORK_ROUTED_MSG_NUM_HOPS
.with_label_values(&[msg.body_variant(), &num_hops.to_string()])
.inc();
}
}
}

Upon inspecting data from all mainnet nodes over the past 1 month, I only see results with hops = 0. It does not seem like we are collecting this metric correctly.

@saketh-are saketh-are added A-network Area: Network C-good-first-issue Category: issues that are self-contained and easy for newcomers to work on. T-core Team: issues relevant to the core team labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network C-good-first-issue Category: issues that are self-contained and easy for newcomers to work on. T-core Team: issues relevant to the core team
Projects
None yet
Development

No branches or pull requests

1 participant