diff --git a/ydb/core/viewer/json_pipe_req.cpp b/ydb/core/viewer/json_pipe_req.cpp index 804e7f37c0e7..7c6ba74a792c 100644 --- a/ydb/core/viewer/json_pipe_req.cpp +++ b/ydb/core/viewer/json_pipe_req.cpp @@ -21,7 +21,7 @@ TViewerPipeClient::TViewerPipeClient(NWilson::TTraceId traceId) { } } -TViewerPipeClient::TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev) +TViewerPipeClient::TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev, const TString& handlerName) : Viewer(viewer) , Event(ev) { @@ -48,7 +48,7 @@ TViewerPipeClient::TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& e traceId = NWilson::TTraceId::NewTraceId(verbosity, ttl); } if (traceId) { - Span = {TComponentTracingLevels::THttp::TopLevel, std::move(traceId), "http", NWilson::EFlags::AUTO_END}; + Span = {TComponentTracingLevels::THttp::TopLevel, std::move(traceId), handlerName ? "http " + handlerName : "http viewer", NWilson::EFlags::AUTO_END}; Span.Attribute("request_type", TString(Event->Get()->Request.GetUri().Before('?'))); } } diff --git a/ydb/core/viewer/json_pipe_req.h b/ydb/core/viewer/json_pipe_req.h index e3e5f3897fe4..f323d371dbf6 100644 --- a/ydb/core/viewer/json_pipe_req.h +++ b/ydb/core/viewer/json_pipe_req.h @@ -170,7 +170,7 @@ class TViewerPipeClient : public TActorBootstrapped { ~TViewerPipeClient(); TViewerPipeClient(); TViewerPipeClient(NWilson::TTraceId traceId); - TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev); + TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev, const TString& handlerName = {}); TActorId ConnectTabletPipe(TTabletId tabletId); void SendEvent(std::unique_ptr event); void SendRequest(TActorId recipient, IEventBase* ev, ui32 flags = 0, ui64 cookie = 0, NWilson::TTraceId traceId = {}); diff --git a/ydb/core/viewer/storage_groups.h b/ydb/core/viewer/storage_groups.h index bf76665b3d10..8b647f2c415c 100644 --- a/ydb/core/viewer/storage_groups.h +++ b/ydb/core/viewer/storage_groups.h @@ -635,7 +635,7 @@ class TStorageGroups : public TViewerPipeClient { } TStorageGroups(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev) - : TBase(viewer, ev) + : TBase(viewer, ev, "/storage/groups") { const auto& params(Event->Get()->Request.GetParams()); Timeout = FromStringWithDefault(params.Get("timeout"), 10000); @@ -1351,6 +1351,7 @@ class TStorageGroups : public TViewerPipeClient { } } if (AreBSControllerRequestsDone() && FieldsNeeded(FieldsWbDisks)) { + AddEvent("SendWhiteboardRequests"); for (TGroup* group : GroupView) { for (TNodeId nodeId : group->VDiskNodeIds) { SendWhiteboardDisksRequest(nodeId); @@ -1881,6 +1882,7 @@ class TStorageGroups : public TViewerPipeClient { } void ReplyAndPassAway() override { + AddEvent("ReplyAndPassAway"); ApplyEverything(); NKikimrViewer::TStorageGroupsInfo json; json.SetVersion(Viewer->GetCapabilityVersion("/storage/groups")); @@ -1977,12 +1979,14 @@ class TStorageGroups : public TViewerPipeClient { jsonGroupGroup.SetGroupCount(groupGroup.Groups.size()); } } + AddEvent("RenderingResult"); TStringStream out; Proto2Json(json, out, { .EnumMode = TProto2JsonConfig::EnumValueMode::EnumName, .StringifyNumbers = TProto2JsonConfig::EStringifyNumbersMode::StringifyInt64Always, .WriteNanAsString = true, }); + AddEvent("ResultReady"); TBase::ReplyAndPassAway(GetHTTPOKJSON(out.Str())); } diff --git a/ydb/core/viewer/viewer_nodes.h b/ydb/core/viewer/viewer_nodes.h index 0ab247971b12..acde455829a9 100644 --- a/ydb/core/viewer/viewer_nodes.h +++ b/ydb/core/viewer/viewer_nodes.h @@ -600,13 +600,8 @@ class TJsonNodes : public TViewerPipeClient { } public: - TString GetLogPrefix() { - static TString prefix = "json/nodes "; - return prefix; - } - TJsonNodes(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev) - : TBase(viewer, ev) + : TBase(viewer, ev, "/viewer/nodes") { const auto& params(Event->Get()->Request.GetParams()); JsonSettings.EnumAsNumbers = !FromStringWithDefault(params.Get("enums"), true); @@ -1600,7 +1595,7 @@ class TJsonNodes : public TViewerPipeClient { void SendWhiteboardSystemAndTabletsBatch(TNodeBatch& batch) { TNodeId nodeId = OffloadMerge ? batch.ChooseNodeId() : 0; if (batch.HasStaticNodes && (FieldsNeeded(FieldsVDisks) || FieldsNeeded(FieldsPDisks))) { - nodeId = 0; // we need to ask for all nodes anyway + nodeId = 0; // we need to ask for all nodes anyway (for the compatibility with older versions) } if (nodeId) { if (FieldsNeeded(FieldsSystemState) && SystemViewerResponse.count(nodeId) == 0) { @@ -2221,12 +2216,15 @@ class TJsonNodes : public TViewerPipeClient { jsonNodeGroup.SetNodeCount(nodeGroup.Nodes.size()); } } + AddEvent("RenderingResult"); TStringStream out; Proto2Json(json, out, { .EnumMode = TProto2JsonConfig::EnumValueMode::EnumName, + .MapAsObject = true, .StringifyNumbers = TProto2JsonConfig::EStringifyNumbersMode::StringifyInt64Always, .WriteNanAsString = true, }); + AddEvent("ResultReady"); TBase::ReplyAndPassAway(GetHTTPOKJSON(out.Str())); }