mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-26 22:01:04 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			942 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			942 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package grpc
 | |
| 
 | |
| import (
 | |
| 	"github.com/coredns/coredns/plugin"
 | |
| 
 | |
| 	"github.com/prometheus/client_golang/prometheus"
 | |
| 	"github.com/prometheus/client_golang/prometheus/promauto"
 | |
| )
 | |
| 
 | |
| // Variables declared for monitoring.
 | |
| var (
 | |
| 	RequestCount = promauto.NewCounterVec(prometheus.CounterOpts{
 | |
| 		Namespace: plugin.Namespace,
 | |
| 		Subsystem: "grpc",
 | |
| 		Name:      "requests_total",
 | |
| 		Help:      "Counter of requests made per upstream.",
 | |
| 	}, []string{"to"})
 | |
| 	RcodeCount = promauto.NewCounterVec(prometheus.CounterOpts{
 | |
| 		Namespace: plugin.Namespace,
 | |
| 		Subsystem: "grpc",
 | |
| 		Name:      "responses_total",
 | |
| 		Help:      "Counter of requests made per upstream.",
 | |
| 	}, []string{"rcode", "to"})
 | |
| 	RequestDuration = promauto.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"})
 | |
| )
 |