Skip to content
Snippets Groups Projects
Commit 9dfebf6d authored by ale's avatar ale
Browse files

Initialize all counters at startup

parent c741ae51
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,10 @@ func hark(ports []int, stopCh chan struct{}) error { ...@@ -48,6 +48,10 @@ func hark(ports []int, stopCh chan struct{}) error {
} }
listeners = append(listeners, l) listeners = append(listeners, l)
// Reset the counter explicitly so the metrics appear even
// before the first connection.
connections.WithLabelValues(strconv.Itoa(port)).Add(0)
wg.Add(1) wg.Add(1)
go func(port int) { go func(port int) {
listener(l, port) listener(l, port)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment