@@ -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