Add metrics to SetAuditorHead and Distinguished updates
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
Chris Eager 2026-04-29 15:55:54 -05:00 committed by Chris Eager
parent 3758e05dd2
commit 92bd50c0e2
2 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,12 @@ func distinguishedUpdate(updateHandler *KtUpdateHandler) {
}, 5*time.Second)
metrics.IncrCounterWithLabels([]string{"distinguished_update"}, 1, []metrics.Label{successLabel(err)})
if err == nil {
treeHead, _, err := updateHandler.tx.GetHead()
if err != nil {
util.Log().Warnf("failed to fetch head: %v", err)
return
}
metrics.SetGauge([]string{"distinguished.tree_size"}, float32(treeHead.TreeSize))
return
}
util.Log().Warnf("Failed to update distinguished key: %v", err)

View File

@ -1043,6 +1043,10 @@ func (t *Tree) SetAuditorHead(head *pb.AuditorTreeHead, auditorName string) erro
return err
}
labels := []metrics.Label{{"auditor", auditorName}}
metrics.SetGaugeWithLabels([]string{"set_auditor_head.signature_latency_seconds"}, float32(time.Duration(now-then)/time.Second), labels)
metrics.SetGaugeWithLabels([]string{"set_auditor_head.tree_size"}, float32(head.TreeSize), labels)
return nil
}