]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-mixing: fix ceph_hosts variable 48851/head
authorTatjana Dehler <tdehler@suse.com>
Fri, 11 Nov 2022 15:30:55 +0000 (16:30 +0100)
committerTatjana Dehler <tdehler@suse.com>
Fri, 11 Nov 2022 15:35:05 +0000 (16:35 +0100)
Do only use `instance` to query for hostnames in single-cluster-mode.
Consider the cluster matcher only in multi-cluster-mode. In this case
the query will look like:
`"label_values({cluster=~\"$cluster\"}, instance)"`.

Fixes: https://tracker.ceph.com/issues/57987
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
monitoring/ceph-mixin/dashboards/host.libsonnet
monitoring/ceph-mixin/dashboards_out/host-details.json

index 3e0b31f2c4595fe110ffdc2b0f8bb390f8aee4e4..24c7755b1cd107ef0d389d715b3a3ecfa1d15c9a 100644 (file)
@@ -318,7 +318,7 @@ local g = import 'grafonnet/grafana.libsonnet';
     .addTemplate(
       $.addTemplateSchema('ceph_hosts',
                           '$datasource',
-                          'label_values({%(clusterMatcher)s}, instance)' % $.matchers(),
+                          if $._config.showMultiCluster then ('label_values({%(clusterMatcher)s}, instance)' % $.matchers()) else 'label_values(instance)',
                           1,
                           false,
                           3,
index 93c51f00941072123cc56e7e7a7651b8f4432f22..ca97a31de2e6870f01940f754a570bee1a2573e2 100644 (file)
             "multi": false,
             "name": "ceph_hosts",
             "options": [ ],
-            "query": "label_values({}, instance)",
+            "query": "label_values(instance)",
             "refresh": 1,
             "regex": "([^.:]*).*",
             "sort": 3,