]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: fix loki grpc port and liniting errors
authorAvan Thakkar <athakkar@redhat.com>
Thu, 10 Feb 2022 09:23:15 +0000 (14:53 +0530)
committerAdam King <adking@redhat.com>
Tue, 3 May 2022 00:48:34 +0000 (20:48 -0400)
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit a25738e49030ae77a105ea244843a7ab0b83aee6)

src/pybind/mgr/cephadm/services/monitoring.py
src/pybind/mgr/cephadm/templates/services/grafana/ceph-dashboard.yml.j2
src/pybind/mgr/cephadm/templates/services/grafana/loki-datasource.yml.j2 [deleted file]
src/pybind/mgr/cephadm/templates/services/loki.yml.j2
src/pybind/mgr/orchestrator/_interface.py

index 0e1da36e76134f4496e762d3f92e0634790b99ec..be759c3e75dfa83929a73b16d3593d0935269ef3 100644 (file)
@@ -36,13 +36,13 @@ class GrafanaService(CephadmService):
             prom_services.append(build_url(scheme='http', host=addr, port=port))
 
             deps.append(dd.name())
-            
+
         loki_services = []  # type: List[str]
         for dd in self.mgr.cache.get_daemons_by_service('mgr'):
             addr = self.mgr.inventory.get_addr(dd.hostname)
-            loki_services.append(build_url(scheme='http', host=addr, port=3100))    
+            loki_services.append(build_url(scheme='http', host=addr, port=3100))
         grafana_data_sources = self.mgr.template.render(
-            'services/grafana/ceph-dashboard.yml.j2', {'hosts': prom_services, 'loki_hosts': loki_services})
+            'services/grafana/ceph-dashboard.yml.j2', {'hosts': prom_services, 'loki_host': loki_services[0]})
 
         cert = self.mgr.get_store('grafana_crt')
         pkey = self.mgr.get_store('grafana_key')
index 95c3ca28cc433854b249b176d4302ecb78667ee5..663a712c5091fdea0dc56fa97f9e83fa9037cc09 100644 (file)
@@ -4,10 +4,9 @@ deleteDatasources:
   - name: 'Dashboard{{ loop.index }}'
     orgId: 1
 {% endfor %}
-{% for loki_host in loki_hosts %}
-  - name: 'Loki{{ loop.index }}'
+
+  - name: 'Loki'
     orgId: 1
-{% endfor %}
 
 datasources:
 {% for host in hosts %}
@@ -25,7 +24,7 @@ datasources:
     type: 'loki'
     access: 'proxy'
     orgId: 1
-    url: '{{ loki_hosts[0] }}'
+    url: '{{ loki_host }}'
     basicAuth: false
     isDefault: true
     editable: false
diff --git a/src/pybind/mgr/cephadm/templates/services/grafana/loki-datasource.yml.j2 b/src/pybind/mgr/cephadm/templates/services/grafana/loki-datasource.yml.j2
deleted file mode 100644 (file)
index 7f8623d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# {{ cephadm_managed }}
-deleteDatasources:
-{% for loki_host in loki_hosts %}
-  - name: 'Loki{{ loop.index }}'
-    orgId: 1
-{% endfor %}
-
-datasources:
-  - name: 'Loki{{ loop.index }}'
-    type: 'loki'
-    access: 'proxy'
-    orgId: 1
-    url: '{{ loki_hosts }}'
-    basicAuth: false
-    isDefault: {{ 'true' if loop.first else 'false' }}
-    editable: false
index c6ce531c205fe3fe5f1871748bf854e458ecd1c8..ce29445f05dc5e83c5df49004f9c65a23ee318e2 100644 (file)
@@ -2,7 +2,7 @@ auth_enabled: false
 
 server:
   http_listen_port: 3100
-  grpc_listen_port: 0
+  grpc_listen_port: 8080
 
 common:
   path_prefix: /tmp/loki
index 2804ca0d563389be2798be1b99ce3297f6c0c1e0..b4f11bf1e78f7db3abfcb93cf14c5036a293325d 100644 (file)
@@ -643,11 +643,11 @@ class Orchestrator(object):
     def apply_node_exporter(self, spec: ServiceSpec) -> OrchResult[str]:
         """Update existing a Node-Exporter daemon(s)"""
         raise NotImplementedError()
-    
+
     def apply_loki(self, spec: ServiceSpec) -> OrchResult[str]:
         """Update existing a Loki daemon(s)"""
         raise NotImplementedError()
-    
+
     def apply_promtail(self, spec: ServiceSpec) -> OrchResult[str]:
         """Update existing a Promtail daemon(s)"""
         raise NotImplementedError()