diff options
author | 2022-09-08 14:56:27 -0400 | |
---|---|---|
committer | 2022-09-08 14:56:27 -0400 | |
commit | b56b080a7c1125cd97c0a2edd7ae21bc1bdcd2a5 (patch) | |
tree | 1494a9542db6d6f69db39113734c8518a6701daf /plugin/cache/metrics.go | |
parent | 1f0a41a66597cb8ab4aace8ea5b5bad880bcd23b (diff) | |
download | coredns-b56b080a7c1125cd97c0a2edd7ae21bc1bdcd2a5.tar.gz coredns-b56b080a7c1125cd97c0a2edd7ae21bc1bdcd2a5.tar.zst coredns-b56b080a7c1125cd97c0a2edd7ae21bc1bdcd2a5.zip |
plugin/view: Advanced routing interface and new 'view' plugin (#5538)
* introduce new interface "dnsserver.Viewer", that allows a plugin implementing it to decide if a query should be routed into its server block.
* add new plugin "view", that uses the new interface to enable a user to define expression based conditions that must be met for a query to be routed to its server block.
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/cache/metrics.go')
-rw-r--r-- | plugin/cache/metrics.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugin/cache/metrics.go b/plugin/cache/metrics.go index 2eb573113..77edb0286 100644 --- a/plugin/cache/metrics.go +++ b/plugin/cache/metrics.go @@ -14,54 +14,54 @@ var ( Subsystem: "cache", Name: "entries", Help: "The number of elements in the cache.", - }, []string{"server", "type", "zones"}) + }, []string{"server", "type", "zones", "view"}) // cacheRequests is a counter of all requests through the cache. cacheRequests = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "cache", Name: "requests_total", Help: "The count of cache requests.", - }, []string{"server", "zones"}) + }, []string{"server", "zones", "view"}) // cacheHits is counter of cache hits by cache type. cacheHits = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "cache", Name: "hits_total", Help: "The count of cache hits.", - }, []string{"server", "type", "zones"}) + }, []string{"server", "type", "zones", "view"}) // cacheMisses is the counter of cache misses. - Deprecated cacheMisses = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "cache", Name: "misses_total", Help: "The count of cache misses. Deprecated, derive misses from cache hits/requests counters.", - }, []string{"server", "zones"}) + }, []string{"server", "zones", "view"}) // cachePrefetches is the number of time the cache has prefetched a cached item. cachePrefetches = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "cache", Name: "prefetch_total", Help: "The number of times the cache has prefetched a cached item.", - }, []string{"server", "zones"}) + }, []string{"server", "zones", "view"}) // cacheDrops is the number responses that are not cached, because the reply is malformed. cacheDrops = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "cache", Name: "drops_total", Help: "The number responses that are not cached, because the reply is malformed.", - }, []string{"server", "zones"}) + }, []string{"server", "zones", "view"}) // servedStale is the number of requests served from stale cache entries. servedStale = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "cache", Name: "served_stale_total", Help: "The number of requests served from stale cache entries.", - }, []string{"server", "zones"}) + }, []string{"server", "zones", "view"}) // evictions is the counter of cache evictions. evictions = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: plugin.Namespace, Subsystem: "cache", Name: "evictions_total", Help: "The count of cache evictions.", - }, []string{"server", "type", "zones"}) + }, []string{"server", "type", "zones", "view"}) ) |