add zones label to cache metrics (#5124)

* add zones to cache metrics

Signed-off-by: Elijah Andrews <elijahcandrews@gmail.com>
This commit is contained in:
Elijah Andrews
2022-02-14 12:10:30 -05:00
committed by GitHub
parent d97dbbef61
commit 80195c399f
5 changed files with 35 additions and 31 deletions

View File

@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"strconv"
"strings"
"time"
"github.com/coredns/caddy"
@@ -185,6 +186,7 @@ func cacheParse(c *caddy.Controller) (*Cache, error) {
}
ca.Zones = origins
ca.zonesMetricLabel = strings.Join(origins, ",")
ca.pcache = cache.New(ca.pcap)
ca.ncache = cache.New(ca.ncap)
}