Skip to content

Commit

Permalink
chore: init metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
zsluedem committed Feb 1, 2024
1 parent 146e432 commit d9ee482
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions crates/metrics/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ pub fn describe_grpc_metrics() {
describe_counter!(GRPC_REQUEST, "grpc request count");
describe_counter!(GRPC_REQUEST_SUCCESS, "grpc request success count");
describe_counter!(GRPC_REQUEST_FAILED, "grpc request failed count");
counter!(GRPC_REQUEST).absolute(0);
counter!(GRPC_REQUEST_SUCCESS).absolute(0);
counter!(GRPC_REQUEST_FAILED).absolute(0);
}
9 changes: 8 additions & 1 deletion crates/metrics/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,12 @@ pub fn describe_mempool_metrics() {
describe_counter!(
REPUTATION_SET_ENTRY_ERROR,
"The number of errors when setting a reputation entry"
)
);
counter!(MEMPOOL_ADD_ERROR).absolute(0);
counter!(MEMPOOL_REMOVE_ERROR).absolute(0);
counter!(REPUTATION_SET_ENTRY_ERROR).absolute(0);
gauge!(MEMPOOL_SIZE).set(0f64);
gauge!(REPUTATION_UO_SEEN).set(0f64);
gauge!(REPUTATION_UO_INCLUDED).set(0f64);
gauge!(REPUTATION_STATUS).set(0f64);
}
5 changes: 4 additions & 1 deletion crates/metrics/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,8 @@ impl<F: Future<Output = MethodResponse>> Future for MetricsFuture<F> {
pub fn describe_json_rpc_metrics() {
describe_counter!(RPC_REQUEST, "The number of json rpc requests so far");
describe_counter!(RPC_REQUEST_SUCCESS, "The number of successful json rpc requests so far");
describe_counter!(RPC_REQUEST_FAILED, "The number of failed json rpc requests so far")
describe_counter!(RPC_REQUEST_FAILED, "The number of failed json rpc requests so far");
counter!(RPC_REQUEST).absolute(0);
counter!(RPC_REQUEST_SUCCESS).absolute(0);
counter!(RPC_REQUEST_FAILED).absolute(0);
}

0 comments on commit d9ee482

Please sign in to comment.