diff --git a/api/apihttp/apihttp.go b/api/apihttp/apihttp.go index 616892fa3..d7637778e 100644 --- a/api/apihttp/apihttp.go +++ b/api/apihttp/apihttp.go @@ -56,6 +56,9 @@ func HealthCheckHandler(w http.ResponseWriter, r *http.Request) { timer2 := prometheus.NewTimer(prometheus.ObserverFunc(metrics.FuncDuration.Set)) defer timer2.ObserveDuration() + timer3 := prometheus.NewTimer(metrics.RequestSummary) + defer timer3.ObserveDuration() + // Do something here that takes time. time.Sleep(time.Duration(rand.NormFloat64()*10000+50000) * time.Microsecond) diff --git a/metrics/metrics.go b/metrics/metrics.go index 406b254e0..786b23ec9 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -184,6 +184,13 @@ var ( }, ) + RequestSummary = prometheus.NewSummary( + prometheus.SummaryOpts{ + Name: "example_function_durations_seconds", + Help: "example function latency distributions.", + }, + ) + RequestDuration = prometheus.NewHistogram( prometheus.HistogramOpts{ Name: "example_request_duration_seconds", @@ -220,6 +227,7 @@ var ( Publisher_batches_process_seconds, FuncDuration, + RequestSummary, RequestDuration, } )