You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2026/03/20 01:25:10 UTC

(kudu) 01/02: [server] use the 'counter' type for the 'uptime' metric

This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit ad93bb73de58b60d855812b3ba3e60e4d9834a43
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Wed Mar 18 15:44:13 2026 -0700

    [server] use the 'counter' type for the 'uptime' metric
    
    This patch changes the type of the 'counter' metric from 'gauge'
    'counter': the metric's value monotonically increases by definition.
    
    I didn't add any automated tests to cover this update, but I manually
    verified that the 'uptime' metric is now listed as a metric of the
    'counter' type when fetching data from master's and tserver's
    "/metrics_prometheus" HTTP endpoint.
    
    Change-Id: I00ef652ff5b38c600593b7fab7664d8e990f8669
    Reviewed-on: http://gerrit.cloudera.org:8080/24115
    Tested-by: Alexey Serbin <al...@apache.org>
    Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
---
 src/kudu/server/server_base.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/kudu/server/server_base.cc b/src/kudu/server/server_base.cc
index dc38a030e..8b25e31f5 100644
--- a/src/kudu/server/server_base.cc
+++ b/src/kudu/server/server_base.cc
@@ -342,7 +342,8 @@ METRIC_DEFINE_gauge_int64(server, uptime,
                           "Server Uptime",
                           kudu::MetricUnit::kMicroseconds,
                           "Time interval since the server has started",
-                          kudu::MetricLevel::kInfo);
+                          kudu::MetricLevel::kInfo,
+                          kudu::EXPOSE_AS_COUNTER);
 METRIC_DEFINE_gauge_int64(server, wal_dir_space_available_bytes,
                           "WAL Directory Space Free",
                           kudu::MetricUnit::kBytes,