From 035b80d07aea799827852215ba3825678e68d133 Mon Sep 17 00:00:00 2001 From: "denis.tarasenko" Date: Sat, 15 Jun 2024 12:35:51 +0300 Subject: [PATCH] [DEX-2306] feat: fix metrics --- CHANGELOG.md | 6 ++++++ .../instrumentation/yabeda_metrics_listener.rb | 4 ++-- lib/sbmt/kafka_consumer/version.rb | 2 +- .../instrumentation/yabeda_metrics_listener_spec.rb | 6 +++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a2f48f..0748e79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +## [2.4.1] - 2024-06-15 + +### Fixed + +- Fixed display of metrics `kafka_api_calls` and `kafka_api_errors` + ## [2.4.0] - 2024-06-06 ### Added diff --git a/lib/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener.rb b/lib/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener.rb index b22ff6d..c34ef71 100644 --- a/lib/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener.rb +++ b/lib/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener.rb @@ -129,7 +129,7 @@ def report_broker_stats(brokers) } Yabeda.kafka_api.calls - .increment(broker_tags, by: broker_statistics["tx"]) + .increment(broker_tags, by: broker_statistics["tx_d"]) Yabeda.kafka_api.latency .measure(broker_tags, broker_statistics["rtt"]["avg"]) Yabeda.kafka_api.request_size @@ -137,7 +137,7 @@ def report_broker_stats(brokers) Yabeda.kafka_api.response_size .measure(broker_tags, broker_statistics["rxbytes"]) Yabeda.kafka_api.errors - .increment(broker_tags, by: broker_statistics["txerrs"] + broker_statistics["rxerrs"]) + .increment(broker_tags, by: broker_statistics["txerrs_d"] + broker_statistics["rxerrs_d"]) end end diff --git a/lib/sbmt/kafka_consumer/version.rb b/lib/sbmt/kafka_consumer/version.rb index 9132be5..5a418e2 100644 --- a/lib/sbmt/kafka_consumer/version.rb +++ b/lib/sbmt/kafka_consumer/version.rb @@ -2,6 +2,6 @@ module Sbmt module KafkaConsumer - VERSION = "2.4.0" + VERSION = "2.4.1" end end diff --git a/spec/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener_spec.rb b/spec/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener_spec.rb index 0d8dc89..9ae1f5c 100644 --- a/spec/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener_spec.rb +++ b/spec/sbmt/kafka_consumer/instrumentation/yabeda_metrics_listener_spec.rb @@ -15,12 +15,12 @@ "name" => "kafka:9092/1001", "nodeid" => 1001, "nodename" => "kafka:9092", - "tx" => 7, + "tx_d" => 7, "txbytes" => 338, - "txerrs" => 0, + "txerrs_d" => 0, "rx" => 7, "rxbytes" => 827, - "rxerrs" => 0, + "rxerrs_d" => 0, "rtt" => { "avg" => 1984 }