Skip to content

Add req/resp metrics from additional PeerDAS list#6430

Closed
KatyaRyazantseva wants to merge 8 commits intosigp:unstablefrom
KatyaRyazantseva:libp2p-metrics
Closed

Add req/resp metrics from additional PeerDAS list#6430
KatyaRyazantseva wants to merge 8 commits intosigp:unstablefrom
KatyaRyazantseva:libp2p-metrics

Conversation

@KatyaRyazantseva
Copy link
Contributor

Issue Addressed

This PR addresses issue #6018

Proposed Changes

The following list of metrics is implemented:

  • Number of requests sent (counter)
  • Number of requests bytes sent (counter)
  • Number of requests received (counter)
  • Number of requests bytes received (counter)
  • Number of responses sent (counter)
  • Number of responses bytes sent (counter)
  • Number of responses received (counter)
  • Number of responses bytes received (counter)

},
)))
}
SupportedProtocol::PingV1 => Ok(Some(InboundRequest::Ping(Ping {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I need to count Ping in TOTAL_RPC_REQUESTS_BYTES_RECEIVED metric?

decoded_buffer,
)?)))
}
SupportedProtocol::GoodbyeV1 => Ok(Some(InboundRequest::Goodbye(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I need to count Goodbye in TOTAL_RPC_REQUESTS_BYTES_RECEIVED metric?

@chong-he chong-he added ready-for-review The code is ready for review das Data Availability Sampling labels Sep 24, 2024
@jimmygchen jimmygchen self-assigned this Oct 1, 2024
&metrics::TOTAL_RPC_REQUESTS_BYTES_SENT,
&[item.into()],
dst.len() as u64,
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Feels wrong to place a metric inside an encode function in a code struct, may be best to place this on the consumer of this function?

)?,
},
))),
SupportedProtocol::DataColumnsByRangeV1 => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a lot of repetition in this match, you can turn SupportedProtocol into a str and have a single register metric call

)
});
pub static TOTAL_RPC_REQUESTS: LazyLock<Result<IntCounterVec>> = LazyLock::new(|| {
try_create_int_counter_vec("libp2p_rpc_requests_total", "RPC requests total", &["type"])
Copy link
Member

Choose a reason for hiding this comment

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

We generally avoid renaming metrics as it is a breaking change for users, but I do agree the current name is not just unclear but also a bit misleading, so I think this is a good change. I'll marked this PR as breaking change so we remember to mention it in our release notes.

This dashboard needs to be updated too:
https://github.com/sigp/lighthouse-metrics/blob/9c654c48d108180cfec48398c9410ae80839047e/dashboards/Network.json#L2620

@jimmygchen jimmygchen added the backwards-incompat Backwards-incompatible API change label Oct 4, 2024
@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Nov 5, 2024
@jimmygchen jimmygchen removed their assignment Feb 10, 2025
@mergify
Copy link

mergify bot commented Feb 10, 2025

This pull request has merge conflicts. Could you please resolve them @KatyaRyazantseva? 🙏

@jimmygchen
Copy link
Member

Closing this PR due to long period of inactivity - some of these metric changes are likely outdated and conflicts with the current code. Feel free to re-open this if you'd like to continue work on this.

@jimmygchen jimmygchen closed this May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards-incompat Backwards-incompatible API change das Data Availability Sampling waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants