1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-26 13:48:53 +08:00

Add Objectives field to Summary metric instantiation (#1772)

Signed-off-by: Charlie Evans <charlie@janga.la>
This commit is contained in:
charlie-jangala 2023-04-27 23:26:04 +01:00 committed by GitHub
parent 54c7518316
commit 3b84258a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,10 +16,11 @@ func MakeMetrics(namespace, subsystem string) (*kitprometheus.Counter, *kitprome
Help: "Number of requests received.",
}, []string{"method"})
latency := kitprometheus.NewSummaryFrom(stdprometheus.SummaryOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "request_latency_microseconds",
Help: "Total duration of requests in microseconds.",
Namespace: namespace,
Subsystem: subsystem,
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
Name: "request_latency_microseconds",
Help: "Total duration of requests in microseconds.",
}, []string{"method"})
return counter, latency