From 3b4bbebc98db8411b996291ae30c5d15800ea107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20D=C3=A9trez?= Date: Tue, 23 Aug 2022 17:23:42 +0200 Subject: Add metrics for log time and tree size --- sigsum-witness.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sigsum-witness.py b/sigsum-witness.py index 87e073e..5de433a 100755 --- a/sigsum-witness.py +++ b/sigsum-witness.py @@ -51,6 +51,12 @@ SIGNING_ERROR = prometheus.Counter( LAST_SUCCESS = prometheus.Gauge( "sigsum_witness_last_success", "Time of last successful signature" ) +LOG_TIME = prometheus.Gauge( + "sigsum_witness_log_time_unixtime", "Latest tree-head timestamp from the log." +) +TREE_SIZE = prometheus.Gauge( + "sigsum_witness_tree_size", "Latest tree size from the log." +) ERR_OK = 0 ERR_USAGE = os.EX_USAGE @@ -546,6 +552,8 @@ class Witness(threading.Thread): ERR_TREEHEAD_SIGNATURE_INVALID, "ERROR: signature of current tree head invalid", ) + LOG_TIME.set(new_tree_head.timestamp) + TREE_SIZE.set(new_tree_head.tree_size) err = sign_send_store_tree_head( self.signing_key, self.log_verification_key, new_tree_head ) -- cgit v1.2.3