From 08019f15741e9ea36cfa1f1ab946a69a3d3a4f21 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Wed, 20 Dec 2023 18:25:55 +0300 Subject: [PATCH] [#280] Add put requests to duration metric Signed-off-by: Marina Biryukova --- api/middleware/metrics.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/middleware/metrics.go b/api/middleware/metrics.go index a0b860c8..1370c3bc 100644 --- a/api/middleware/metrics.go +++ b/api/middleware/metrics.go @@ -95,10 +95,8 @@ func stats(f http.HandlerFunc, resolveCID cidResolveFunc, appMetrics *metrics.Ap } } - if r.Method == http.MethodGet { - // Increment the prometheus http request response histogram with appropriate label - appMetrics.Statistic().RequestDurationsUpdate(reqInfo.API, durationSecs) - } + // Increment the prometheus http request response histogram with appropriate label + appMetrics.Statistic().RequestDurationsUpdate(reqInfo.API, durationSecs) appMetrics.Statistic().TotalInputBytesAdd(in.countBytes) appMetrics.Statistic().TotalOutputBytesAdd(out.countBytes)