Skip to content

Commit c41289f

Browse files
authored
tune trace names (#9540)
1 parent 873eaad commit c41289f

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

ydb/core/viewer/json_pipe_req.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TViewerPipeClient::TViewerPipeClient(NWilson::TTraceId traceId) {
2121
}
2222
}
2323

24-
TViewerPipeClient::TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev)
24+
TViewerPipeClient::TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev, const TString& handlerName)
2525
: Viewer(viewer)
2626
, Event(ev)
2727
{
@@ -48,7 +48,7 @@ TViewerPipeClient::TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& e
4848
traceId = NWilson::TTraceId::NewTraceId(verbosity, ttl);
4949
}
5050
if (traceId) {
51-
Span = {TComponentTracingLevels::THttp::TopLevel, std::move(traceId), "http", NWilson::EFlags::AUTO_END};
51+
Span = {TComponentTracingLevels::THttp::TopLevel, std::move(traceId), handlerName ? "http " + handlerName : "http viewer", NWilson::EFlags::AUTO_END};
5252
Span.Attribute("request_type", TString(Event->Get()->Request.GetUri().Before('?')));
5353
}
5454
}

ydb/core/viewer/json_pipe_req.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class TViewerPipeClient : public TActorBootstrapped<TViewerPipeClient> {
170170
~TViewerPipeClient();
171171
TViewerPipeClient();
172172
TViewerPipeClient(NWilson::TTraceId traceId);
173-
TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev);
173+
TViewerPipeClient(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev, const TString& handlerName = {});
174174
TActorId ConnectTabletPipe(TTabletId tabletId);
175175
void SendEvent(std::unique_ptr<IEventHandle> event);
176176
void SendRequest(TActorId recipient, IEventBase* ev, ui32 flags = 0, ui64 cookie = 0, NWilson::TTraceId traceId = {});

ydb/core/viewer/storage_groups.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ class TStorageGroups : public TViewerPipeClient {
635635
}
636636

637637
TStorageGroups(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev)
638-
: TBase(viewer, ev)
638+
: TBase(viewer, ev, "/storage/groups")
639639
{
640640
const auto& params(Event->Get()->Request.GetParams());
641641
Timeout = FromStringWithDefault<ui32>(params.Get("timeout"), 10000);
@@ -1351,6 +1351,7 @@ class TStorageGroups : public TViewerPipeClient {
13511351
}
13521352
}
13531353
if (AreBSControllerRequestsDone() && FieldsNeeded(FieldsWbDisks)) {
1354+
AddEvent("SendWhiteboardRequests");
13541355
for (TGroup* group : GroupView) {
13551356
for (TNodeId nodeId : group->VDiskNodeIds) {
13561357
SendWhiteboardDisksRequest(nodeId);
@@ -1881,6 +1882,7 @@ class TStorageGroups : public TViewerPipeClient {
18811882
}
18821883

18831884
void ReplyAndPassAway() override {
1885+
AddEvent("ReplyAndPassAway");
18841886
ApplyEverything();
18851887
NKikimrViewer::TStorageGroupsInfo json;
18861888
json.SetVersion(Viewer->GetCapabilityVersion("/storage/groups"));
@@ -1977,12 +1979,14 @@ class TStorageGroups : public TViewerPipeClient {
19771979
jsonGroupGroup.SetGroupCount(groupGroup.Groups.size());
19781980
}
19791981
}
1982+
AddEvent("RenderingResult");
19801983
TStringStream out;
19811984
Proto2Json(json, out, {
19821985
.EnumMode = TProto2JsonConfig::EnumValueMode::EnumName,
19831986
.StringifyNumbers = TProto2JsonConfig::EStringifyNumbersMode::StringifyInt64Always,
19841987
.WriteNanAsString = true,
19851988
});
1989+
AddEvent("ResultReady");
19861990
TBase::ReplyAndPassAway(GetHTTPOKJSON(out.Str()));
19871991
}
19881992

ydb/core/viewer/viewer_nodes.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,8 @@ class TJsonNodes : public TViewerPipeClient {
600600
}
601601

602602
public:
603-
TString GetLogPrefix() {
604-
static TString prefix = "json/nodes ";
605-
return prefix;
606-
}
607-
608603
TJsonNodes(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev)
609-
: TBase(viewer, ev)
604+
: TBase(viewer, ev, "/viewer/nodes")
610605
{
611606
const auto& params(Event->Get()->Request.GetParams());
612607
JsonSettings.EnumAsNumbers = !FromStringWithDefault<bool>(params.Get("enums"), true);
@@ -1600,7 +1595,7 @@ class TJsonNodes : public TViewerPipeClient {
16001595
void SendWhiteboardSystemAndTabletsBatch(TNodeBatch& batch) {
16011596
TNodeId nodeId = OffloadMerge ? batch.ChooseNodeId() : 0;
16021597
if (batch.HasStaticNodes && (FieldsNeeded(FieldsVDisks) || FieldsNeeded(FieldsPDisks))) {
1603-
nodeId = 0; // we need to ask for all nodes anyway
1598+
nodeId = 0; // we need to ask for all nodes anyway (for the compatibility with older versions)
16041599
}
16051600
if (nodeId) {
16061601
if (FieldsNeeded(FieldsSystemState) && SystemViewerResponse.count(nodeId) == 0) {
@@ -2221,12 +2216,15 @@ class TJsonNodes : public TViewerPipeClient {
22212216
jsonNodeGroup.SetNodeCount(nodeGroup.Nodes.size());
22222217
}
22232218
}
2219+
AddEvent("RenderingResult");
22242220
TStringStream out;
22252221
Proto2Json(json, out, {
22262222
.EnumMode = TProto2JsonConfig::EnumValueMode::EnumName,
2223+
.MapAsObject = true,
22272224
.StringifyNumbers = TProto2JsonConfig::EStringifyNumbersMode::StringifyInt64Always,
22282225
.WriteNanAsString = true,
22292226
});
2227+
AddEvent("ResultReady");
22302228
TBase::ReplyAndPassAway(GetHTTPOKJSON(out.Str()));
22312229
}
22322230

0 commit comments

Comments
 (0)