You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by wu...@apache.org on 2022/11/15 06:16:33 UTC

[ambari-metrics] branch master updated: AMBARI-25370: Producer and Customer Request /s graphs are failing on Kafa Grafana dashboards (#60)

This is an automated email from the ASF dual-hosted git repository.

wuzhiguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b1cf17  AMBARI-25370: Producer and Customer Request /s graphs are failing on Kafa Grafana dashboards (#60)
5b1cf17 is described below

commit 5b1cf17e33e635213ae7d362be24103e7d097b8c
Author: Zhiguo Wu <wu...@apache.org>
AuthorDate: Tue Nov 15 14:16:28 2022 +0800

    AMBARI-25370: Producer and Customer Request /s graphs are failing on Kafa Grafana dashboards (#60)
---
 .../ambari-metrics/datasource.js                   | 27 ++++++++++++++++++----
 .../conf/unix/metrics_whitelist                    |  2 ++
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/ambari-metrics-grafana/ambari-metrics/datasource.js b/ambari-metrics-grafana/ambari-metrics/datasource.js
index aa71b29..76b85e3 100644
--- a/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -720,11 +720,28 @@ define([
               }
             }
           }
-          metricsPromises.push(_.map(options.targets, function (target) {
-            target.templatedHost = allHosts ? allHosts : '';
-            target.templatedCluster = templatedCluster;
-            return getAllHostData(target);
-          }));
+          /* The Producer & Comsumer Requests graphs on the Kafka Hosts dashboard should display metrics that are
+           * versioned, thus the value of different versions should be aggregated and grouped by hosts.
+           * In order to have a 'grouped by hosts' like view the metric results are queried for each hosts separately.
+           */
+          if (!_.isEmpty(options.targets.filter(function(target) {
+            return target.metric.endsWith(".%.count"); }))) {
+            allHosts = allHosts.split(',');
+            _.forEach(allHosts, function(host) {
+              metricsPromises.push(_.map(options.targets, function(target) {
+                target.templatedHost = host;
+                target.templatedCluster = templatedCluster;
+                return getAllHostData(target);
+              }));
+            });
+          } else {
+            allHosts = templateSrv._texts.hosts === "All" ? '%' : allHosts;
+            metricsPromises.push(_.map(options.targets, function(target) {
+              target.templatedHost = allHosts? allHosts : '';
+              target.templatedCluster = templatedCluster;
+              return getAllHostData(target);
+            }));
+          }
           metricsPromises = _.flatten(metricsPromises);
         } else {
           // Non Templatized Dashboards
diff --git a/ambari-metrics-timelineservice/conf/unix/metrics_whitelist b/ambari-metrics-timelineservice/conf/unix/metrics_whitelist
index 9be5d70..920cd36 100644
--- a/ambari-metrics-timelineservice/conf/unix/metrics_whitelist
+++ b/ambari-metrics-timelineservice/conf/unix/metrics_whitelist
@@ -280,6 +280,8 @@ kafka.controller.KafkaController.OfflinePartitionsCount
 kafka.log.LogFlushStats.LogFlushRateAndTimeMs.1MinuteRate
 kafka.network.RequestMetrics.RequestsPerSec.request.FetchConsumer.count
 kafka.network.RequestMetrics.RequestsPerSec.request.Produce.count
+kafka.network.RequestMetrics.RequestsPerSec.request.FetchConsumer.version.*.count
+kafka.network.RequestMetrics.RequestsPerSec.request.Produce.version.*.count
 kafka.network.RequestMetrics.TotalTimeMs.request.FetchConsumer.99percentile
 kafka.network.RequestMetrics.TotalTimeMs.request.FetchConsumer.max
 kafka.network.RequestMetrics.TotalTimeMs.request.FetchConsumer.mean


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org