From f62bbd3f0e9fe10f021f29314725405e282e51ab Mon Sep 17 00:00:00 2001 From: pboros Date: Mon, 19 Jan 2026 10:39:36 +0000 Subject: [PATCH 1/2] log status if the database is reported as not available --- db/conn.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/conn.go b/db/conn.go index 82b9c0c..6f79a6c 100644 --- a/db/conn.go +++ b/db/conn.go @@ -123,7 +123,8 @@ func GetStatus() (*models.FullStatus, error) { if status.Cluster == nil || status.Cluster.DatabaseLockState == nil || status.Cluster.FaultTolerance == nil || - status.Cluster.Data == nil { + status.Cluster.Data == nil || + status.Cluster.DatabaseAvailable == false { log.Debug().Str("status_json", string(statusJson.([]byte))).Msg("status json is missing cluster fields") } } From 2cb3d9a4cfbc88806a87b8e5c11583cd661b91e8 Mon Sep 17 00:00:00 2001 From: pboros Date: Mon, 19 Jan 2026 10:44:13 +0000 Subject: [PATCH 2/2] log the time took to fetch an incomplete or not available status --- db/conn.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/db/conn.go b/db/conn.go index 6f79a6c..20dccf9 100644 --- a/db/conn.go +++ b/db/conn.go @@ -20,6 +20,7 @@ import ( "os" "regexp" "strconv" + "time" "github.com/rs/zerolog/log" ulog "github.com/tigrisdata/fdb-exporter/util/log" @@ -100,6 +101,7 @@ func getFdb() fdb.Database { } func GetStatus() (*models.FullStatus, error) { + start := time.Now() conn := getFdb() var status models.FullStatus statusKey := append([]byte{255, 255}, []byte("/status/json")...) @@ -125,7 +127,15 @@ func GetStatus() (*models.FullStatus, error) { status.Cluster.FaultTolerance == nil || status.Cluster.Data == nil || status.Cluster.DatabaseAvailable == false { - log.Debug().Str("status_json", string(statusJson.([]byte))).Msg("status json is missing cluster fields") + statusString := string(statusJson.([]byte)) + log.Debug().Str("status_json", statusString).Msg("status json is missing cluster fields") + + d := time.Since(start) + log.Debug(). + Dur("took", d). + Str("status_json", statusString). + Msg("status json is missing cluster fields") + } }