Skip to content

Commit c1e6d45

Browse files
authored
Merge 29668ae into c146758
2 parents c146758 + 29668ae commit c1e6d45

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ydb/core/fq/libs/actors/pending_fetcher.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,23 +359,30 @@ class TPendingFetcher : public NActors::TActorBootstrapped<TPendingFetcher> {
359359
const TString cloudId = task.sensor_labels().at("cloud_id");
360360
const TString queryId = task.query_id().value();
361361

362+
TString queryIdLabel = queryId;
363+
if (task.automatic()) {
364+
queryIdLabel = (task.query_type() == FederatedQuery::QueryContent::STREAMING) ? "streaming" : "automatic";
365+
} else {
366+
if (task.query_type() == FederatedQuery::QueryContent::ANALYTICS) {
367+
queryIdLabel = "analytics";
368+
}
369+
}
370+
362371
::NYql::NCommon::TServiceCounters queryCounters(ServiceCounters);
363372
auto publicCountersParent = ServiceCounters.PublicCounters;
364373

365374
if (cloudId && folderId) {
366375
publicCountersParent = publicCountersParent->GetSubgroup("cloud_id", cloudId)->GetSubgroup("folder_id", folderId);
367376
}
368-
queryCounters.PublicCounters = publicCountersParent->GetSubgroup("query_id",
369-
task.automatic() ? (task.query_name() ? task.query_name() : "automatic") : queryId);
377+
queryCounters.PublicCounters = publicCountersParent->GetSubgroup("query_id", queryIdLabel);
370378

371379
auto rootCountersParent = ServiceCounters.RootCounters;
372380
std::set<std::pair<TString, TString>> sensorLabels(task.sensor_labels().begin(), task.sensor_labels().end());
373381
for (const auto& [label, item]: sensorLabels) {
374382
rootCountersParent = rootCountersParent->GetSubgroup(label, item);
375383
}
376384

377-
queryCounters.RootCounters = rootCountersParent->GetSubgroup("query_id",
378-
task.automatic() ? (folderId ? "automatic_" + folderId : "automatic") : queryId);
385+
queryCounters.RootCounters = rootCountersParent->GetSubgroup("query_id", queryIdLabel);
379386
queryCounters.Counters = queryCounters.RootCounters;
380387

381388
queryCounters.InitUptimeCounter();

0 commit comments

Comments
 (0)