aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew-rykov <arykov@ydb.tech>2023-07-24 16:05:02 +0300
committerandrew-rykov <arykov@ydb.tech>2023-07-24 16:05:02 +0300
commit31939fb829d7b341d52b952010891ebf2e1eb806 (patch)
tree65f6fb6d3c1fe7e060767257d11d2f5e09aa9b13
parent441a59ffc7f7913545a87c67e8c66b4a4dfc11e5 (diff)
downloadydb-31939fb829d7b341d52b952010891ebf2e1eb806.tar.gz
KIKIMR-18215 monitoring metrics response time
use info from appdata KIKIMR-18215 metrics
-rw-r--r--ydb/core/mon/async_http_mon.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/ydb/core/mon/async_http_mon.cpp b/ydb/core/mon/async_http_mon.cpp
index fa5d69165a..d56d0c221d 100644
--- a/ydb/core/mon/async_http_mon.cpp
+++ b/ydb/core/mon/async_http_mon.cpp
@@ -16,6 +16,7 @@
#include <util/system/hostname.h>
+#include <ydb/core/base/counters.h>
#include <ydb/core/protos/mon.pb.h>
#include "mon_impl.h"
@@ -208,9 +209,17 @@ public:
}
SendRequest();
}
-
void ReplyWith(NHttp::THttpOutgoingResponsePtr response) {
Send(Event->Sender, new NHttp::TEvHttpProxy::TEvHttpOutgoingResponse(response));
+
+ TString url(Event->Get()->Request->URL.Before('?'));
+ TString status(response->Status);
+ NMonitoring::THistogramPtr ResponseTimeHgram = NKikimr::GetServiceCounters(NKikimr::AppData()->Counters, "utils")
+ ->GetSubgroup("subsystem", "mon")
+ ->GetSubgroup("url", url)
+ ->GetSubgroup("status", status)
+ ->GetHistogram("ResponseTimeMs", NMonitoring::ExponentialHistogram(20, 2, 1));
+ ResponseTimeHgram->Collect(Event->Get()->Request->Timer.Passed() * 1000);
}
void ReplyOptionsAndPassAway() {