TUN-1270: cloudflared panic (HA metrics missing label)
This commit is contained in:
parent
8e2908f889
commit
b2d0c612a5
|
@ -35,11 +35,12 @@ func NewTunnelsForHA() tunnelsForHA {
|
||||||
func (t *tunnelsForHA) AddTunnelID(haConn uint8, tunnelID string) {
|
func (t *tunnelsForHA) AddTunnelID(haConn uint8, tunnelID string) {
|
||||||
t.Lock()
|
t.Lock()
|
||||||
defer t.Unlock()
|
defer t.Unlock()
|
||||||
|
haStr := fmt.Sprintf("%v", haConn)
|
||||||
if oldTunnelID, ok := t.entries[haConn]; ok {
|
if oldTunnelID, ok := t.entries[haConn]; ok {
|
||||||
t.metrics.WithLabelValues(oldTunnelID).Dec()
|
t.metrics.WithLabelValues(oldTunnelID, haStr).Dec()
|
||||||
}
|
}
|
||||||
t.entries[haConn] = tunnelID
|
t.entries[haConn] = tunnelID
|
||||||
t.metrics.WithLabelValues(tunnelID, fmt.Sprintf("%v", haConn)).Inc()
|
t.metrics.WithLabelValues(tunnelID, haStr).Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tunnelsForHA) String() string {
|
func (t *tunnelsForHA) String() string {
|
||||||
|
|
Loading…
Reference in New Issue