From ecffa454e86b994b79dfc6fb9032d02ee95a0697 Mon Sep 17 00:00:00 2001 From: John Martin Date: Mon, 4 Nov 2024 13:13:22 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20high=20cardinality=20address=20?= =?UTF-8?q?label=20from=20safe=5Fclient=5Flatency=20(=E2=80=A6=20(#20169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …#20165) ## Description safe_client_latency is the highest cardinality metric across our observability system due to the `address` label + being a histogram: ``` root@sui-node-mysten-rpc-0:/sui# curl -s localhost:9184/metrics | grep safe_client_latency_bucket | wc -l 8512 ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: ## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- crates/sui-core/src/safe_client.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/sui-core/src/safe_client.rs b/crates/sui-core/src/safe_client.rs index e1f01bfa46831..c0c7a53086858 100644 --- a/crates/sui-core/src/safe_client.rs +++ b/crates/sui-core/src/safe_client.rs @@ -68,10 +68,11 @@ impl SafeClientMetricsBase { registry, ) .unwrap(), + // Address label is removed to reduce high cardinality, can be added back if needed latency: register_histogram_vec_with_registry!( "safe_client_latency", - "RPC latency observed by safe client aggregator, group by address and method", - &["address", "method"], + "RPC latency observed by safe client aggregator, group by method", + &["method"], mysten_metrics::COARSE_LATENCY_SEC_BUCKETS.to_vec(), registry, ) @@ -113,16 +114,16 @@ impl SafeClientMetrics { let handle_transaction_latency = metrics_base .latency - .with_label_values(&[&validator_address, "handle_transaction"]); + .with_label_values(&["handle_transaction"]); let handle_certificate_latency = metrics_base .latency - .with_label_values(&[&validator_address, "handle_certificate"]); + .with_label_values(&["handle_certificate"]); let handle_obj_info_latency = metrics_base .latency - .with_label_values(&[&validator_address, "handle_object_info_request"]); + .with_label_values(&["handle_object_info_request"]); let handle_tx_info_latency = metrics_base .latency - .with_label_values(&[&validator_address, "handle_transaction_info_request"]); + .with_label_values(&["handle_transaction_info_request"]); Self { total_requests_handle_transaction_info_request,