@@ -9,25 +9,25 @@ import (
99 "github.com/prometheus/client_golang/prometheus/promhttp"
1010)
1111
12- var (
13- requestsProcessed = promauto .NewCounter (prometheus.CounterOpts {
14- Name : "go_request_operations_total" ,
15- Help : "The total number of processed requests" ,
12+
13+ var requestsProcessed = promauto .NewCounter (prometheus.CounterOpts {
14+ Name : "go_request_operations_total" ,
15+ Help : "The total number of processed requests" ,
1616 })
17+
18+
19+ var requestDuration = prometheus .NewHistogramVec (prometheus.HistogramOpts {
20+ Name : "go_request_duration_seconds" ,
21+ Help : "Histogram for the duration in seconds." ,
22+ Buckets : []float64 {1 , 2 , 5 , 6 , 10 },
23+ } ,
24+ []string {"endpoint" },
1725)
1826
1927func main () {
2028
2129 fmt .Println ("starting..." )
2230
23- requestDuration := prometheus .NewHistogramVec (prometheus.HistogramOpts {
24- Name : "go_request_duration_seconds" ,
25- Help : "Histogram for the duration in seconds." ,
26- Buckets : []float64 {1 , 2 , 5 , 6 , 10 },
27- },
28- []string {"endpoint" },
29- )
30-
3131 prometheus .MustRegister (requestDuration )
3232
3333 http .HandleFunc ("/" , func (w http.ResponseWriter , r * http.Request ) {
0 commit comments