plugin/forward: add hit/miss metrics for connection cache (#4114)

Signed-off-by: Ruslan Drozhdzh <rdrozhdzh@infoblox.com>
This commit is contained in:
Ruslan Drozhdzh
2020-09-14 12:42:55 +03:00
committed by GitHub
parent 2fe5d684f9
commit 30a4a87eaa
3 changed files with 18 additions and 2 deletions

View File

@@ -54,8 +54,10 @@ func (t *Transport) Dial(proto string) (*persistConn, bool, error) {
pc := <-t.ret
if pc != nil {
ConnCacheHitsCount.WithLabelValues(t.addr, proto).Add(1)
return pc, true, nil
}
ConnCacheMissesCount.WithLabelValues(t.addr, proto).Add(1)
reqTime := time.Now()
timeout := t.dialTimeout()