[ 
https://issues.apache.org/jira/browse/AMBARI-24898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16687279#comment-16687279
 ] 

ASF GitHub Bot commented on AMBARI-24898:
-----------------------------------------

ishanbha closed pull request #10: [AMBARI-24898] Add cluster drop down to 
Grafana aggregate dashboards.
URL: https://github.com/apache/ambari-metrics/pull/10
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ambari-metrics-grafana/ambari-metrics/datasource.js 
b/ambari-metrics-grafana/ambari-metrics/datasource.js
index 6e14f33..c6885da 100644
--- a/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -689,14 +689,9 @@ define([
             });
           }
           // To speed up querying on templatized dashboards.
-          var indexOfHosts = -1;
-          for (var i = 0; i < templateSrv.variables.length; i++) {
-            if (templateSrv.variables[i].name == 'hosts' && 
templateSrv.index.hosts) {
-              indexOfHosts = i;
-            }
-          }
-          if (indexOfHosts >= 0) {
-            let allHosts = [];
+          let allHosts;
+          if (templateSrv.index.hosts) {
+            allHosts = [];
             const hosts = templateSrv.index.hosts.options
             for (let host of hosts) {
               if (host.text.toLowerCase() === "all" && host.selected) {
@@ -705,13 +700,13 @@ define([
               } else if (host.selected) {
                 allHosts.push(host.text);
               }
-            };
-            metricsPromises.push(_.map(options.targets, function (target) {
-              target.templatedHost = allHosts ? allHosts : '';
-              target.templatedCluster = templatedCluster;
-              return getAllHostData(target);
-            }));
+            }
           }
+          metricsPromises.push(_.map(options.targets, function (target) {
+            target.templatedHost = allHosts ? allHosts : '';
+            target.templatedCluster = templatedCluster;
+            return getAllHostData(target);
+          }));
           metricsPromises = _.flatten(metricsPromises);
         } else {
           // Non Templatized Dashboards


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add cluster drop down to Grafana aggregate dashboards.
> ------------------------------------------------------
>
>                 Key: AMBARI-24898
>                 URL: https://issues.apache.org/jira/browse/AMBARI-24898
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-metrics
>            Reporter: Ishan Bhatt
>            Assignee: Ishan Bhatt
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.8.0
>
>
> Currently, the HOST based dashboards (System-Servers, HDFS Namenodes, 
> HBase-Regionservers etc) have a dropdown for the cluster level selection. 
> This selection determines the set of hosts in the HOST dropdown, and the 
> cluster is tagged in the API call made by every graph in the dashboard 
> through the "instanceId" query parameter.
> We need to add the cluster dropdown to aggregate dashboards as well. This 
> cluster selection will also be tagged in the API call (instanceId) like in 
> other dashboards.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to