Debian Codegraph @

cmd/atomdns/handlers/global/metrics.go

raw
1 package global
2
3 import (
4 "github.com/prometheus/client_golang/prometheus"
5 "github.com/prometheus/client_golang/prometheus/promauto"
6 )
7
8 var (
9 // HealthDuration is the metric used for exporting how fast we can retrieve the /health endpoint.
10 HealthDuration = promauto.NewHistogram(prometheus.HistogramOpts{
11 Namespace: Namespace,
12 Subsystem: subsystem,
13 Name: "request_duration_seconds",
14 Buckets: prometheus.ExponentialBuckets(0.00025, 10, 5), // from 0.25ms to 2.5 seconds
15 NativeHistogramBucketFactor: 1.05,
16 Help: "Histogram of the time (in seconds) each request took.",
17 })
18 // HealthFailures is the metric used to count how many times the health request failed
19 HealthFailures = promauto.NewCounter(prometheus.CounterOpts{
20 Namespace: Namespace,
21 Subsystem: subsystem,
22 Name: "request_failures_total",
23 Help: "The number of times the health check failed.",
24 })
25 )
26
27 const (
28 subsystem = "health"
29 Namespace = "atomdns"
30 )