From ae6ca189cddf718ddcc9d173bcae7e1ab2fc954f Mon Sep 17 00:00:00 2001 From: Amitanand Aiyer Date: Mon, 5 Apr 2021 09:51:37 -0700 Subject: [PATCH] [#7927] Rename deprecated old-rocksdb-metric-name rocksdb_total_sst_file_size to rocksdb_current_version_sst_files_size Summary: https://phabricator.dev.yugabyte.com/D6987 from Aug 2019, introduced rocksdb_current_version_sst_files_size metrics. However, for backwards comatibility reasons the metric is also exported under the old name: viz: rocksdb_total_sst_file_size This diff updates YW to use the new name instead of the old name. Test Plan: eye-ball Reviewers: timur, daniel, bogdan Reviewed By: daniel, bogdan Subscribers: rao, jenkins-bot, ybase Differential Revision: https://phabricator.dev.yugabyte.com/D11152 --- cloud/grafana/YugabyteDB.json | 2 +- .../java/com/yugabyte/yw/controllers/TablesController.java | 3 ++- managed/src/main/resources/metrics.yml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cloud/grafana/YugabyteDB.json b/cloud/grafana/YugabyteDB.json index e56c5376676d..ebb3d4f9f5c6 100644 --- a/cloud/grafana/YugabyteDB.json +++ b/cloud/grafana/YugabyteDB.json @@ -7868,7 +7868,7 @@ "steppedLine": false, "targets": [ { - "expr": "avg(sum without (table_id, table_name) (rocksdb_total_sst_file_size{node_prefix=\"$dbcluster\"})) / 1073741824", + "expr": "avg(sum without (table_id, table_name) (rocksdb_current_version_sst_files_size{node_prefix=\"$dbcluster\"})) / 1073741824", "hide": false, "interval": "", "legendFormat": "Size of SSTables", diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/TablesController.java b/managed/src/main/java/com/yugabyte/yw/controllers/TablesController.java index 68376c0e3346..c6a8bf695bce 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/TablesController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/TablesController.java @@ -570,7 +570,8 @@ public boolean disableBackupOnTables(List tableUuids, Universe universe) { private HashMap queryTableSizes(String nodePrefix) { // Execute query and check for errors. ArrayList values = metricQueryHelper.queryDirect( - "sum by (table_id) (rocksdb_total_sst_file_size{node_prefix=\"" + nodePrefix + "\"})" + "sum by (table_id) (rocksdb_current_version_sst_files_size{node_prefix=\"" + + nodePrefix + "\"})" ); HashMap result = new HashMap(); diff --git a/managed/src/main/resources/metrics.yml b/managed/src/main/resources/metrics.yml index 7169b82a2f33..30c2ec82e4ba 100644 --- a/managed/src/main/resources/metrics.yml +++ b/managed/src/main/resources/metrics.yml @@ -1285,7 +1285,7 @@ lsm_rocksdb_num_seeks_per_node: "rocksdb_number_db_seek": "Seek" lsm_rocksdb_total_sst_per_node: - metric: "rocksdb_total_sst_file_size" + metric: "rocksdb_current_version_sst_files_size" function: "sum without (table_id, table_name)|avg" operator: "/ 1073741824" filters: @@ -1296,7 +1296,7 @@ lsm_rocksdb_total_sst_per_node: type: "date" yaxis: alias: - "rocksdb_total_sst_file_size": "Size of SSTables" + "rocksdb_current_version_sst_files_size": "Size of SSTables" ticksuffix: " GB" tickformat: ".2f"