enable datasource creation with sidecar

Change-Id: Ifab784be2bbc4e9dfc2ff2ef61298d5c3b2370c1
diff --git a/aether-roc-umbrella/Chart.yaml b/aether-roc-umbrella/Chart.yaml
index e43103c..cde81a5 100644
--- a/aether-roc-umbrella/Chart.yaml
+++ b/aether-roc-umbrella/Chart.yaml
@@ -7,7 +7,7 @@
 description: Aether ROC Umbrella chart to deploy all Aether ROC
 kubeVersion: ">=1.18.0"
 type: application
-version: 1.4.39
+version: 1.4.40
 appVersion: v0.0.0
 keywords:
   - aether
diff --git a/aether-roc-umbrella/files/dashboards/site/site-small-cells.json b/aether-roc-umbrella/files/dashboards/site/site-small-cells.json
index 7d15ae6..6b88af0 100644
--- a/aether-roc-umbrella/files/dashboards/site/site-small-cells.json
+++ b/aether-roc-umbrella/files/dashboards/site/site-small-cells.json
@@ -92,7 +92,7 @@
                 "targets": [
                     {
                         "exemplar": true,
-                        "expr": "sum by (enbname) (mme_number_of_enb_attached{enbname=~\"$enb\"})",
+                        "expr": "sum by (enbname) (mme_number_of_enb_attached{enb_state=\"Active\", enbname=~\"$enb\"})",
                         "interval": "",
                         "legendFormat": "{{enbname}}",
                         "queryType": "randomWalk",
diff --git a/aether-roc-umbrella/files/dashboards/ue/ue-connectivity.json b/aether-roc-umbrella/files/dashboards/ue/ue-connectivity.json
index 3bae4ed..128540d 100644
--- a/aether-roc-umbrella/files/dashboards/ue/ue-connectivity.json
+++ b/aether-roc-umbrella/files/dashboards/ue/ue-connectivity.json
@@ -19,7 +19,7 @@
     "links": [],
     "panels": [
       {
-        "datasource": "$acc",
+        "datasource": "$ds",
         "description": "UE Connectivity",
         "fieldConfig": {
           "defaults": {
@@ -113,7 +113,7 @@
                     "multi" : false,
                     "name" : "imsi",
                     "type" : "query",
-                    "datasource": "$acc",
+                    "datasource": "$ds",
                     "definition": "label_values(subscribers_info, imsi)",
                     "query": {
                         "query": "label_values(subscribers_info, imsi)",
@@ -121,6 +121,16 @@
                     },
                     "refresh": 1,  
                     "sort" : 1
+        },
+	{
+                    "label" : "Datasource",
+                    "multi" : false,
+                    "name" : "ds",
+                    "type" : "datasource",
+                    "query": "prometheus",
+                    "queryValue": "",
+                    "refresh": 1,
+                    "regex": ""
         }
       ]
     },
diff --git a/aether-roc-umbrella/templates/datasources-templated.yaml b/aether-roc-umbrella/templates/datasources-templated.yaml
new file mode 100644
index 0000000..159eb77
--- /dev/null
+++ b/aether-roc-umbrella/templates/datasources-templated.yaml
@@ -0,0 +1,24 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ .Release.Name }}-datasources-templated
+  namespace: {{ .Release.Namespace }}
+  labels:
+          grafana_datasource: "aether-roc-gui"
+data:
+  prom-datasources.yaml: |
+     apiVersion: 1
+     datasources:
+     {{- range .Values.grafana.source }}
+     - name: datasource-{{ .name }}
+       url: {{ .protocol }}://{{ .service }}:{{ .port }}
+       type: prometheus
+       access: proxy
+       jsonData:
+         oauthPassThru: true
+     {{- end }}
+
diff --git a/aether-roc-umbrella/values.yaml b/aether-roc-umbrella/values.yaml
index df08183..383252d 100644
--- a/aether-roc-umbrella/values.yaml
+++ b/aether-roc-umbrella/values.yaml
@@ -153,7 +153,32 @@
     dashboards:
        enabled: true
        label: grafana_dashboard
-       labelValue: aether-roc-gui 
+       labelValue: aether-roc-gui
+    datasources:
+       enabled: true
+       label: grafana_datasource
+       labelValue: aether-roc-gui
+  source:
+  - name: acc
+    protocol: http
+    service: aether-roc-umbrella-prometheus-acc-server
+    port: 80
+  - name: amp
+    protocol: http
+    service: aether-roc-umbrella-prometheus-amp-server
+    port: 80
+  - name: acme-chicago
+    protocol: http
+    service: aether-roc-umbrella-prometheus-ace-server
+    port: 80
+  - name: starbucks-newyork
+    protocol: http
+    service: aether-roc-umbrella-prometheus-ace-server
+    port: 80
+  - name: starbucks-seattle
+    protocol: http
+    service: aether-roc-umbrella-prometheus-ace-server
+    port: 80
   grafana.ini:
     log:
       level: debug
@@ -247,7 +272,7 @@
           scrape_interval: 2s
           static_configs:
             - targets:
-                - sdcore-adapter-v3-exporter:2112
+                - sdcore-adapter-v4-exporter:2112
 
 prometheus-amp:
   pushgateway:
@@ -265,15 +290,15 @@
           scrape_interval: 2s
           static_configs:
             - targets:
-                - sdcore-adapter-v3-exporter:2112
-
+                - sdcore-adapter-v4-exporter:2112
+  
 prometheus-ace:
   pushgateway:
     enabled: false
   nodeExporter:
     enabled: false
   kubeStateMetrics:
-    enabled: false
+    enabled: true
   alertmanager:
     enabled: false
   serverFiles:
@@ -283,7 +308,12 @@
           scrape_interval: 2s
           static_configs:
             - targets:
-                - sdcore-adapter-v3-exporter:2112
+                - sdcore-adapter-v4-exporter:2112
+        - job_name: kube-state-metrics
+          scrape_interval: 2s
+          static_configs:
+            - targets:
+                - aether-roc-umbrella-kube-state-metrics:8080
 
 # SD-Core Test Dummy
 # proxy_pass has to be added or nginx will not log the $request_body