Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-8317

If Keycloak gets provisioned before Metrics, the keycloak dashboard won't be in Grafana

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • metrics

      The Keycloak APB expects to be able to update the grafana-dashboards-configmap with the dashboard for Keycloak, and silently fails if the Metrics APB hasn't already run and created that configmap.

      Here's the tail of such a run of the keycloak-apb:

      TASK [include_role : oc-patch-file-to-configmap] *******************************
      
      TASK [oc-patch-file-to-configmap : Check to see if the specified Config Map exists] ***
      fatal: [localhost]: FAILED! => {"changed": true, "cmd": "oc get configmap grafana-dashboards-configmap -n mobile-shite", "delta": "0:00:00.656978", "end": "2018-12-21 11:33:37.938343", "msg": "non-zero return code", "rc": 1, "start": "2018-12-21 11:33:37.281365", "stderr": "Error from server (NotFound): configmaps \"grafana-dashboards-configmap\" not found", "stderr_lines": ["Error from server (NotFound): configmaps \"grafana-dashboards-configmap\" not found"], "stdout": "", "stdout_lines": []}
      ...ignoring
      
      TASK [oc-patch-file-to-configmap : Print Warning Message about Config Map not Existing] ***
      ok: [localhost] => {
          "msg": "Warning: Cannot add file keycloak-dashboard.json to Config Map grafana-dashboards-configmap. Config Map does not exist."
      }
      
      TASK [oc-patch-file-to-configmap : Create appropriate contents from template for 'oc patch' command] ***
      skipping: [localhost]
      
      TASK [oc-patch-file-to-configmap : Add file to the specified config map] *******
      skipping: [localhost]
      
      TASK [oc-patch-file-to-configmap : Print Debug info about failed oc patch operation] ***
      skipping: [localhost]
      
      PLAY RECAP *********************************************************************
      localhost                  : ok=34   changed=25   unreachable=0    failed=0   
      

      aliok@redhat.com says:

      other dashboards are in Metrics APB and they're added independent if the service shown in the dashboard is available or not; but in case of Keycloak, we do it the other way

      Maybe we should change it so that it works the same as the others?

      Or maybe there's a way to do some configmap acrobatics so that we can populate the dashboards dir from multiple configmaps, and e.g. the first APB to run (of these two) will create a keycloak dashboard? This option (if it's even possible) might mean that if the Keycloak APB ran second, that it might need to restart Grafana for it to pick up on the new dashboard. That could cause some strange race conditions/failures if someone tries to deploy both at once.

              psturc@redhat.com Pavel Sturc
              gryan@redhat.com Gerard Ryan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: