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

Drop rpc replace metrics #2670

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ermineJose
Copy link
Contributor

@ermineJose ermineJose commented Jan 25, 2025

Description

ant-node-manager currently uses rpc server to collect node_information and network_information, replace the rpc server with metric server.

Related Issue

Fixes #<issue_number> (if applicable).

Type of Change

Please mark the types of changes made in this pull request.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

Please ensure all of the following tasks have been completed:

  • I have read the contributing guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have updated the documentation accordingly.
  • I have followed the conventional commits guidelines for commit messages.
  • I have verified my commit messages with commitlint.

@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch from 3786eb7 to cb994a9 Compare January 28, 2025 15:55
ant-networking/src/metrics/service.rs Dismissed Show dismissed Hide dismissed
ant-node-manager/src/cmd/node.rs Dismissed Show dismissed Hide dismissed
ant-service-management/src/metric.rs Fixed Show fixed Hide fixed
@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch from 63cd487 to b0761aa Compare January 28, 2025 16:48
@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch from b0761aa to 35433fc Compare January 28, 2025 16:53
ant-node/src/node.rs Outdated Show resolved Hide resolved
for sample in scrape.samples.iter() {
for (key, value) in sample.labels.iter() {
match key.as_str() {
"peer_id" => node_info.peer_id = value.parse().unwrap(),
Copy link
Member

Choose a reason for hiding this comment

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

We don't use unwrap or expect in our code as it may cause the program to crash instantly, we should return error types here.

Copy link
Member

Choose a reason for hiding this comment

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

All the unwraps have to be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -13,6 +13,7 @@ pub mod error;
pub mod faucet;
pub mod node;
pub mod rpc;
Copy link
Member

Choose a reason for hiding this comment

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

I think all the references to rpc should be removed from our codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ant-service-management has dependency on ant-node-rpc-client module of our source, should i refactor there as well?, i left it intact so that existing changes with ant-node-rpc-client are not broken! or else, i will have to remove them as well!

Comment on lines 160 to 161
impl RpcActions for MetricClient {
async fn node_info(&self) -> Result<NodeInfo> {
Copy link
Member

Choose a reason for hiding this comment

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

Regarding the Action here:

  • We must rename RpcActions -> MetricActions
  • remove the unused methods
  • Also the expect has to be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I was also puzzled about the use of RpcActions. We shouldn't have references to RPC any more.

@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch 3 times, most recently from cb8c46f to db7c11b Compare January 30, 2025 18:16
@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch 2 times, most recently from 7f6233c to d7e2457 Compare February 2, 2025 17:54
ant-node-manager/src/lib.rs Fixed Show fixed Hide fixed
ant-node-manager/src/lib.rs Fixed Show fixed Hide fixed
@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch 3 times, most recently from d7e2457 to f884154 Compare February 3, 2025 06:07
@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch from f884154 to 405c596 Compare February 3, 2025 06:11
ant-service-management/src/metric.rs Dismissed Show dismissed Hide dismissed
@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch from 895fdd5 to fe24576 Compare February 4, 2025 20:34
@ermineJose ermineJose force-pushed the drop-Rpc-replace-Metrics branch from c3851ea to c92f726 Compare February 5, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants