mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	Cleanup a variety of metric issues. * Eliminate department of redundancy "count_total" naming. * Use the plural of the unit when appropriate. (ex, "requests") * Remove label names from metric names where appropriate. (ex, "rcode") * Simplify request metrics by consolidating type label in to the base request counter. * Re-generate man pages. Signed-off-by: Ben Kochie <superq@gmail.com> Co-authored-by: Ben Kochie <superq@gmail.com>
		
			
				
	
	
		
			31 lines
		
	
	
		
			889 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			889 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package grpc
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/coredns/coredns/plugin"
 | 
						|
 | 
						|
	"github.com/prometheus/client_golang/prometheus"
 | 
						|
)
 | 
						|
 | 
						|
// Variables declared for monitoring.
 | 
						|
var (
 | 
						|
	RequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{
 | 
						|
		Namespace: plugin.Namespace,
 | 
						|
		Subsystem: "grpc",
 | 
						|
		Name:      "requests_total",
 | 
						|
		Help:      "Counter of requests made per upstream.",
 | 
						|
	}, []string{"to"})
 | 
						|
	RcodeCount = prometheus.NewCounterVec(prometheus.CounterOpts{
 | 
						|
		Namespace: plugin.Namespace,
 | 
						|
		Subsystem: "grpc",
 | 
						|
		Name:      "responses_total",
 | 
						|
		Help:      "Counter of requests made per upstream.",
 | 
						|
	}, []string{"rcode", "to"})
 | 
						|
	RequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
 | 
						|
		Namespace: plugin.Namespace,
 | 
						|
		Subsystem: "grpc",
 | 
						|
		Name:      "request_duration_seconds",
 | 
						|
		Buckets:   plugin.TimeBuckets,
 | 
						|
		Help:      "Histogram of the time each request took.",
 | 
						|
	}, []string{"to"})
 | 
						|
)
 |