Rename the tail lag metric to ntfy_tail_messages_lag_seconds

This commit is contained in:
binwiederhier committed 2026-10-12 20:35:22 +00:00
1 parent 57e67d9372
commit 9320fbb113
3 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -96,8 +96,8 @@ var (
ClusterLeader = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "ntfy_cluster_leader",
})
TailLagSeconds = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "ntfy_tail_lag_seconds", // Age of the newest message of the last read; well above the write delay means it is behind
TailMessagesLagSeconds = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "ntfy_tail_messages_lag_seconds", // Age of the newest message of the last read; well above the write delay means it is behind
})
TailMessagesRead = prometheus.NewCounter(prometheus.CounterOpts{
Name: "ntfy_tail_messages_read_total",
@@ -135,7 +135,7 @@ func init() {
ClusterQueueDropped,
ClusterMessagesWasted,
ClusterLeader,
TailLagSeconds,
TailMessagesLagSeconds,
TailMessagesRead,
TailMessagesMissed,
Visitors,
+1 -1
View File
@@ -36,7 +36,7 @@ var expectedMetricNames = []string{
"ntfy_messages_published_failure",
"ntfy_messages_published_success",
"ntfy_subscribers_total",
"ntfy_tail_lag_seconds",
"ntfy_tail_messages_lag_seconds",
"ntfy_tail_messages_missed_total",
"ntfy_tail_messages_read_total",
"ntfy_topics_total",
+1 -1
View File
@@ -30,7 +30,7 @@ func (s *Server) runTail(tail *message.Tail) {
continue
}
metrics.TailMessagesRead.Add(float64(len(messages)))
metrics.TailLagSeconds.Set(tailLag(messages, time.Now()).Seconds())
metrics.TailMessagesLagSeconds.Set(tailLag(messages, time.Now()).Seconds())
s.publishMissed(messages)
}
}