correct metrics name of cache size (#3805)
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
This commit is contained in:
parent
7bb32dee7d
commit
4ccd55e95e
6 changed files with 9 additions and 7 deletions
|
@ -94,7 +94,7 @@ Entries with 0 TTL will remain in the cache until randomly evicted when the shar
|
|||
If monitoring is enabled (via the \fIprometheus\fP plugin) then the following metrics are exported:
|
||||
|
||||
.IP \(bu 4
|
||||
\fB\fCcoredns_cache_size{server, type}\fR - Total elements in the cache by cache type.
|
||||
\fB\fCcoredns_cache_entries{server, type}\fR - Total elements in the cache by cache type.
|
||||
.IP \(bu 4
|
||||
\fB\fCcoredns_cache_hits_total{server, type}\fR - Counter of cache hits by cache type.
|
||||
.IP \(bu 4
|
||||
|
|
|
@ -51,6 +51,8 @@ It's mostly dropping `count` from `_total` metrics names:
|
|||
|
||||
* `coredns_reload_failed_count_total` -\> `coredns_reload_failed_total`
|
||||
|
||||
* `coredns_cache_size` -\> `coredns_cache_entries`
|
||||
|
||||
And note that
|
||||
`coredns_dns_request_type_count_total` is now part of `coredns_dns_requests_total` .
|
||||
|
||||
|
|
2
plugin/cache/README.md
vendored
2
plugin/cache/README.md
vendored
|
@ -70,7 +70,7 @@ Entries with 0 TTL will remain in the cache until randomly evicted when the shar
|
|||
|
||||
If monitoring is enabled (via the *prometheus* plugin) then the following metrics are exported:
|
||||
|
||||
* `coredns_cache_size{server, type}` - Total elements in the cache by cache type.
|
||||
* `coredns_cache_entries{server, type}` - Total elements in the cache by cache type.
|
||||
* `coredns_cache_hits_total{server, type}` - Counter of cache hits by cache type.
|
||||
* `coredns_cache_misses_total{server}` - Counter of cache misses.
|
||||
* `coredns_cache_drops_total{server}` - Counter of responses excluded from the cache due to request/response question name mismatch.
|
||||
|
|
2
plugin/cache/metrics.go
vendored
2
plugin/cache/metrics.go
vendored
|
@ -11,7 +11,7 @@ var (
|
|||
cacheSize = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: "cache",
|
||||
Name: "size",
|
||||
Name: "entries",
|
||||
Help: "The number of elements in the cache.",
|
||||
}, []string{"server", "type"})
|
||||
// cacheHits is counter of cache hits by cache type.
|
||||
|
|
|
@ -138,7 +138,7 @@ func TestMetricsAuto(t *testing.T) {
|
|||
// Show that when 2 blocs share the same metric listener (they have a prometheus plugin on the same listening address),
|
||||
// ALL the metrics of the second bloc in order are declared in prometheus, especially the plugins that are used ONLY in the second bloc
|
||||
func TestMetricsSeveralBlocs(t *testing.T) {
|
||||
cacheSizeMetricName := "coredns_cache_size"
|
||||
cacheSizeMetricName := "coredns_cache_entries"
|
||||
addrMetrics := "localhost:9155"
|
||||
|
||||
corefile := fmt.Sprintf(`
|
||||
|
@ -227,7 +227,7 @@ example.com:0 {
|
|||
|
||||
func TestMetricsAvailable(t *testing.T) {
|
||||
procMetric := "coredns_build_info"
|
||||
procCache := "coredns_cache_size"
|
||||
procCache := "coredns_cache_entries"
|
||||
procCacheMiss := "coredns_cache_misses_total"
|
||||
procForward := "coredns_dns_request_duration_seconds"
|
||||
corefileWithMetrics := `
|
||||
|
|
|
@ -209,7 +209,7 @@ func TestMetricsAvailableAfterReload(t *testing.T) {
|
|||
// that is not used in another test
|
||||
promAddress := "127.0.0.1:53186"
|
||||
procMetric := "coredns_build_info"
|
||||
procCache := "coredns_cache_size"
|
||||
procCache := "coredns_cache_entries"
|
||||
procForward := "coredns_dns_request_duration_seconds"
|
||||
corefileWithMetrics := `
|
||||
.:0 {
|
||||
|
@ -263,7 +263,7 @@ func TestMetricsAvailableAfterReloadAndFailedReload(t *testing.T) {
|
|||
// that is not used in another test
|
||||
promAddress := "127.0.0.1:53187"
|
||||
procMetric := "coredns_build_info"
|
||||
procCache := "coredns_cache_size"
|
||||
procCache := "coredns_cache_entries"
|
||||
procForward := "coredns_dns_request_duration_seconds"
|
||||
corefileWithMetrics := `
|
||||
.:0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue