diff options
Diffstat (limited to 'plugin/grpc/metrics.go')
-rw-r--r-- | plugin/grpc/metrics.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugin/grpc/metrics.go b/plugin/grpc/metrics.go new file mode 100644 index 000000000..76b186bee --- /dev/null +++ b/plugin/grpc/metrics.go @@ -0,0 +1,30 @@ +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: "request_count_total", + Help: "Counter of requests made per upstream.", + }, []string{"to"}) + RcodeCount = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: plugin.Namespace, + Subsystem: "grpc", + Name: "response_rcode_count_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"}) +) |