aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Veselov <124132947+siarheivesialou@users.noreply.github.com>2024-01-24 12:27:15 +0300
committerGitHub <noreply@github.com>2024-01-24 12:27:15 +0300
commit902255aefe691f65f89ad22d6df31ed970b45ab7 (patch)
tree6e9e4781aafb781308181912f91654c741de6329
parentf711ded6252758194b442fd05766bfaf2d7a1562 (diff)
downloadydb-902255aefe691f65f89ad22d6df31ed970b45ab7.tar.gz
move ReportLatencyCounters to common call (#1193)
Always report latency counters in serverless proxy
-rw-r--r--ydb/core/http_proxy/http_req.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/ydb/core/http_proxy/http_req.cpp b/ydb/core/http_proxy/http_req.cpp
index 576d42d228..9b824d2815 100644
--- a/ydb/core/http_proxy/http_req.cpp
+++ b/ydb/core/http_proxy/http_req.cpp
@@ -409,13 +409,23 @@ namespace NKikimr::NHttpProxy {
HttpContext.ResponseData.Status = status;
HttpContext.ResponseData.ErrorText = errorText;
- HttpContext.DoReply(ctx, issueCode);
+ ReplyToHttpContext(ctx, issueCode);
ctx.Send(AuthActor, new TEvents::TEvPoisonPill());
TBase::Die(ctx);
}
+ void ReplyToHttpContext(const TActorContext& ctx, std::optional<size_t> issueCode = std::nullopt) {
+ ReportLatencyCounters(ctx);
+
+ if (issueCode.has_value()) {
+ HttpContext.DoReply(ctx, issueCode.value());
+ } else {
+ HttpContext.DoReply(ctx);
+ }
+ }
+
void ReportInputCounters(const TActorContext& ctx) {
if (InputCountersReported) {
@@ -478,7 +488,6 @@ namespace NKikimr::NHttpProxy {
HttpContext.ContentType == MIME_CBOR);
FillOutputCustomMetrics<TProtoResult>(
*(dynamic_cast<TProtoResult*>(ev->Get()->Message.Get())), HttpContext, ctx);
- ReportLatencyCounters(ctx);
/* deprecated metric: */ ctx.Send(MakeMetricsServiceID(),
new TEvServerlessProxy::TEvCounter{1, true, true,
BuildLabels(Method, HttpContext, "api.http.success_per_second", setStreamPrefix)
@@ -495,7 +504,7 @@ namespace NKikimr::NHttpProxy {
{"code", "200"},
{"name", "api.http.data_streams.response.count"}}
});
- HttpContext.DoReply(ctx);
+ ReplyToHttpContext(ctx);
} else {
auto retryClass =
NYdb::NPersQueue::GetRetryErrorClass(ev->Get()->Status->GetStatus());