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>
.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,
"multi": false,
"name": "ceph_hosts",
"options": [ ],
- "query": "label_values({}, instance)",
+ "query": "label_values(instance)",
"refresh": 1,
"regex": "([^.:]*).*",
"sort": 3,