diff options
author | hcpp <hcpp@yandex-team.ru> | 2022-03-23 20:29:26 +0300 |
---|---|---|
committer | hcpp <hcpp@yandex-team.ru> | 2022-03-23 20:29:26 +0300 |
commit | 7afd7916c878f99b1a666ff6b3027595d740275b (patch) | |
tree | 793d940cc2ceb90edc931f2e9cf14b7949b12a46 | |
parent | 97b04c23a5839ba7768ceae283cfd6fcee190ac5 (diff) | |
download | ydb-7afd7916c878f99b1a666ff6b3027595d740275b.tar.gz |
metrics by label has been added YQ-978
ref:d308e3397b32cf6810a87618fe494970b31ff1bc
-rw-r--r-- | ydb/core/yq/libs/actors/pending_fetcher.cpp | 5 | ||||
-rw-r--r-- | ydb/core/yq/libs/actors/task_get.cpp | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ydb/core/yq/libs/actors/pending_fetcher.cpp b/ydb/core/yq/libs/actors/pending_fetcher.cpp index 95dda9c762a..fc73d4b85cc 100644 --- a/ydb/core/yq/libs/actors/pending_fetcher.cpp +++ b/ydb/core/yq/libs/actors/pending_fetcher.cpp @@ -328,6 +328,11 @@ private: task.automatic() ? (task.query_name() ? task.query_name() : "automatic") : queryId); auto rootCountersParent = ServiceCounters.RootCounters; + std::set<std::pair<TString, TString>> sensorLabels(task.sensor_labels().begin(), task.sensor_labels().end()); + for (const auto& [label, item]: sensorLabels) { + rootCountersParent = rootCountersParent->GetSubgroup(label, item); + } + queryCounters.RootCounters = rootCountersParent->GetSubgroup("query_id", task.automatic() ? (folderId ? "automatic_" + folderId : "automatic") : queryId); queryCounters.Counters = queryCounters.RootCounters; diff --git a/ydb/core/yq/libs/actors/task_get.cpp b/ydb/core/yq/libs/actors/task_get.cpp index 2e01366ed97..eb54ac7fa79 100644 --- a/ydb/core/yq/libs/actors/task_get.cpp +++ b/ydb/core/yq/libs/actors/task_get.cpp @@ -161,6 +161,7 @@ private: newTask->set_status(task.Query.meta().status()); *newTask->mutable_created_topic_consumers() = task.Internal.created_topic_consumers(); newTask->mutable_sensor_labels()->insert({"cloud_id", task.Internal.cloud_id()}); + newTask->mutable_sensor_labels()->insert({"scope", task.Scope}); newTask->set_automatic(task.Query.content().automatic()); newTask->set_query_name(task.Query.content().name()); *newTask->mutable_deadline() = NProtoInterop::CastToProto(task.Deadline); |