You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "arshadmohammad (via GitHub)" <gi...@apache.org> on 2023/05/18 07:41:55 UTC

[GitHub] [ambari] arshadmohammad opened a new pull request, #3698: AMBARI-25944: Update dashboard definition when dashboard version is changed

arshadmohammad opened a new pull request, #3698:
URL: https://github.com/apache/ambari/pull/3698

   ## What changes were proposed in this pull request?
   
   when dashboard version is changed, update dashboard definition in grafana while starting the ambari-metrics grafana 
   
   ## How was this patch teste
   Build ambari after the change and tested it. Screenshot attached in jira
   
   Please review [Ambari Contributing Guide](https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute) before opening a pull request.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [ambari] virajjasani commented on a diff in pull request #3698: AMBARI-25944: Update dashboard definition when dashboard version is changed

Posted by "virajjasani (via GitHub)" <gi...@apache.org>.
virajjasani commented on code in PR #3698:
URL: https://github.com/apache/ambari/pull/3698#discussion_r1204874483


##########
ambari-server/src/main/resources/common-services/AMBARI_METRICS/3.0.0/package/scripts/metrics_grafana_util.py:
##########
@@ -451,17 +451,27 @@ def create_ams_dashboards():
         if "id" in dashboard_def:
           dashboard_def['id'] = None
         # Set correct tags
+
+        dashboardVersion='-1'
+        if 'version' in dashboard_def:
+          dashboardVersion = str(dashboard_def['version'])
+
         if 'tags' in dashboard_def:
           dashboard_def['tags'].append('builtin')
           dashboard_def['tags'].append(version)
+          dashboard_def['tags'].append(dashboardVersion)
         else:
-          dashboard_def['tags'] = [ 'builtin', version ]
-        
+          dashboard_def['tags'] = [ 'builtin', version, dashboardVersion ]
         for dashboard in existing_dashboards:
           if dashboard.title == dashboard_def['title']:
             if version not in dashboard.tags:
-              # Found existing dashboard with wrong version - update dashboard
+              # Found existing dashboard with wrong ambari version - update dashboard
+              update_def = True
+            elif dashboardVersion not in dashboard.tags:
+              # Found existing dashboard with wrong dashboard version - update dashboard
               update_def = True

Review Comment:
   can it be simplified to this?
   ```
   if version not in dashboard.tags or dashboardVersion not in dashboard.tags:
     # Found existing dashboard with wrong ambari version or dashboard version - update dashboard
     update_def = True
   else:
     update_def = False # Skip update
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [ambari] virajjasani commented on pull request #3698: AMBARI-25944: Update dashboard definition when dashboard version is changed

Posted by "virajjasani (via GitHub)" <gi...@apache.org>.
virajjasani commented on PR #3698:
URL: https://github.com/apache/ambari/pull/3698#issuecomment-1572296236

   The minor nit can be addressed later, planning to merge this PR in 24 hr unless any objections.
   Thanks @arshadmohammad for fixing this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [ambari] virajjasani merged pull request #3698: AMBARI-25944: Update dashboard definition when dashboard version is changed

Posted by "virajjasani (via GitHub)" <gi...@apache.org>.
virajjasani merged PR #3698:
URL: https://github.com/apache/ambari/pull/3698


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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