bug fixes

This commit is contained in:
9seconds
2019-10-10 17:48:30 +03:00
parent 2eba78b0db
commit d459efcf9c
9 changed files with 38 additions and 12 deletions
+4 -1
View File
@@ -77,7 +77,7 @@ func (s *statsPrometheus) changeTelegramConnections(dc conntypes.DC, addr *net.T
labels[1] = "ipv6"
}
s.connections.WithLabelValues(labels[:]...).Add(increment)
s.telegramConnections.WithLabelValues(labels[:]...).Add(increment)
}
func (s *statsPrometheus) Crash() {
@@ -122,6 +122,9 @@ func newStatsPrometheus(mux *http.ServeMux) (Interface, error) {
if err := registry.Register(instance.connections); err != nil {
return nil, fmt.Errorf("cannot register metrics for connections: %w", err)
}
if err := registry.Register(instance.telegramConnections); err != nil {
return nil, fmt.Errorf("cannot register metrics for telegram connections: %w", err)
}
if err := registry.Register(instance.traffic); err != nil {
return nil, fmt.Errorf("cannot register metrics for traffic: %w", err)
}
+1 -1
View File
@@ -63,7 +63,7 @@ func (s *statsStatsd) TelegramDisconnected(dc conntypes.DC, addr *net.TCPAddr) {
func (s *statsStatsd) changeTelegramConnections(dc conntypes.DC, addr *net.TCPAddr, value int) {
labels := [...]string{
"telegram",
"telegram_connections",
strconv.Itoa(int(dc)),
"ipv4",
}