diff options
author | savnik <savnik@yandex-team.com> | 2023-08-31 16:42:07 +0300 |
---|---|---|
committer | savnik <savnik@yandex-team.com> | 2023-08-31 17:17:55 +0300 |
commit | e356d91847be487767b338e55c06c1a75ab23bc9 (patch) | |
tree | 243388f754ee67f101e181a3407a9827aaacd37e | |
parent | 818c1177fde466069375a75baee43d8b997bfd99 (diff) | |
download | ydb-e356d91847be487767b338e55c06c1a75ab23bc9.tar.gz |
Fix topic name in kafka metrics
-rw-r--r-- | ydb/core/kafka_proxy/actors/kafka_produce_actor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ydb/core/kafka_proxy/actors/kafka_produce_actor.cpp b/ydb/core/kafka_proxy/actors/kafka_produce_actor.cpp index 926ede3640..69f87290f4 100644 --- a/ydb/core/kafka_proxy/actors/kafka_produce_actor.cpp +++ b/ydb/core/kafka_proxy/actors/kafka_produce_actor.cpp @@ -49,8 +49,9 @@ void TKafkaProduceActor::LogEvent(IEventHandle& ev) { } void TKafkaProduceActor::SendMetrics(const TString& topicName, size_t delta, const TString& name, const TActorContext& ctx) { - ctx.Send(MakeKafkaMetricsServiceID(), new TEvKafka::TEvUpdateCounter(delta, BuildLabels(Context, "", topicName, TStringBuilder() << "api.kafka.produce." << name, ""))); - ctx.Send(MakeKafkaMetricsServiceID(), new TEvKafka::TEvUpdateCounter(delta, BuildLabels(Context, "", topicName, "api.kafka.produce.total_messages", ""))); + auto topic = SplitPath(topicName).back(); + ctx.Send(MakeKafkaMetricsServiceID(), new TEvKafka::TEvUpdateCounter(delta, BuildLabels(Context, "", topic, TStringBuilder() << "api.kafka.produce." << name, ""))); + ctx.Send(MakeKafkaMetricsServiceID(), new TEvKafka::TEvUpdateCounter(delta, BuildLabels(Context, "", topic, "api.kafka.produce.total_messages", ""))); } void TKafkaProduceActor::Bootstrap(const NActors::TActorContext& /*ctx*/) { |