diff --git a/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.cpp b/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.cpp index 8340bbf62f19..503a4dd969a7 100644 --- a/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.cpp +++ b/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.cpp @@ -10,4 +10,12 @@ TString TSchemaColumn::ToString() const { return TStringBuilder() << "'" << Name << "' : " << TypeYson; } +//// TCountersDesc + +TCountersDesc TCountersDesc::SetPath(const TString& countersPath) const { + TCountersDesc result(*this); + result.CountersPath = countersPath; + return result; +} + } // namespace NFq::NRowDispatcher diff --git a/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.h b/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.h index 64513700a029..6acf230fa2d5 100644 --- a/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.h +++ b/ydb/core/fq/libs/row_dispatcher/format_handler/common/common.h @@ -28,6 +28,8 @@ struct TCountersDesc { NMonitoring::TDynamicCounterPtr CountersRoot = MakeIntrusive(); NMonitoring::TDynamicCounterPtr CountersSubgroup = MakeIntrusive(); TString CountersPath; // Used for counters created from CountersRoot + + [[nodiscard]] TCountersDesc SetPath(const TString& countersPath) const; }; } // namespace NFq::NRowDispatcher diff --git a/ydb/core/fq/libs/row_dispatcher/format_handler/format_handler.cpp b/ydb/core/fq/libs/row_dispatcher/format_handler/format_handler.cpp index b658b7bf0d4d..299551928817 100644 --- a/ydb/core/fq/libs/row_dispatcher/format_handler/format_handler.cpp +++ b/ydb/core/fq/libs/row_dispatcher/format_handler/format_handler.cpp @@ -284,7 +284,7 @@ class TTopicFormatHandler : public NActors::TActor, public public: TTopicFormatHandler(const TFormatHandlerConfig& config, const TSettings& settings, const TCountersDesc& counters) : TBase(&TTopicFormatHandler::StateFunc) - , TTypeParser(__LOCATION__, counters) + , TTypeParser(__LOCATION__, counters.SetPath("row_dispatcher")) , Config(config) , Settings(settings) , LogPrefix(TStringBuilder() << "TTopicFormatHandler [" << Settings.ParsingFormat << "]: ") @@ -487,11 +487,12 @@ class TTopicFormatHandler : public NActors::TActor, public } TValueStatus CreateParserForFormat() const { + const auto& counters = Counters.Counters.SetPath("row_dispatcher_parser"); if (Settings.ParsingFormat == "raw") { - return CreateRawParser(ParserHandler, Counters.Counters); + return CreateRawParser(ParserHandler, counters); } if (Settings.ParsingFormat == "json_each_row") { - return CreateJsonParser(ParserHandler, Config.JsonParserConfig, Counters.Counters); + return CreateJsonParser(ParserHandler, Config.JsonParserConfig, counters); } return TStatus::Fail(EStatusId::INTERNAL_ERROR, TStringBuilder() << "Unsupported parsing format: " << Settings.ParsingFormat); } diff --git a/ydb/core/fq/libs/row_dispatcher/topic_session.cpp b/ydb/core/fq/libs/row_dispatcher/topic_session.cpp index 3c25acdf45da..d44dd18710a9 100644 --- a/ydb/core/fq/libs/row_dispatcher/topic_session.cpp +++ b/ydb/core/fq/libs/row_dispatcher/topic_session.cpp @@ -726,7 +726,7 @@ void TTopicSession::Handle(NFq::TEvRowDispatcher::TEvStartSession::TPtr& ev) { ActorContext(), FormatHandlerConfig, handlerSettings, - {.CountersRoot = CountersRoot, .CountersSubgroup = Metrics.PartitionGroup, .CountersPath = "topic_session"} + {.CountersRoot = CountersRoot, .CountersSubgroup = Metrics.PartitionGroup} )}).first; }