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

Add req/resp metrics from additional PeerDAS list #6430

Open
wants to merge 8 commits into
base: unstable
Choose a base branch
from

Conversation

KatyaRyazantseva
Copy link

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
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?

Ok(Some(InboundRequest::Status(StatusMessage::from_ssz_bytes(
decoded_buffer,
)?)))
}
SupportedProtocol::GoodbyeV1 => Ok(Some(InboundRequest::Goodbye(
Copy link
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

@@ -122,9 +122,64 @@ pub static TOTAL_RPC_ERRORS_PER_CLIENT: LazyLock<Result<IntCounterVec>> = LazyLo
&["client", "rpc_error", "direction"],
)
});
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
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