Skip to content

Commit f7314a9

Browse files
author
Koenraad Verheyden
committed
grafana-builder: make allValue configurable
grafana#469 changed the default allValue for addMultiTemplate from `null` to `'.+'`. I want to make it configurable. Reason: we use addMultiTemplate to add a namespace dropdown in the tempo-mixin: https://github.com/grafana/tempo/blob/a1a95b35e15741061fc7119256aaeab78083dfbc/operations/tempo-mixin/dashboard-utils.libsonnet#L28 https://github.com/grafana/tempo/blob/a1a95b35e15741061fc7119256aaeab78083dfbc/operations/tempo-mixin/yamls/tempo-resources.json#L1873-L1900 This dropdown is populated with the namespaces a Tempo cluster is running in. The current behaviour (with `allValue: '.+'`) is confusing, because selecting All in the dropdown ends up querying all namespaces. The previous behaviour (with `allValue: null`) only queries the namespaces that are returned by the query. The reason we got confused is that in our dashboard you can select a cluster and if you know there is only 1 Tempo namespace in that cluster you kind of expect to only see data from that namespace. But with `allValue: '.+'` you get data from all namespaces in that cluster. So we're mistakenly looking at queriers from a non-Tempo cluster and wondering why CPU was so high.
1 parent c4975f7 commit f7314a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

grafana-builder/grafana.libsonnet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
rows+: [row { panels: panels }],
1414
},
1515

16-
addTemplate(name, metric_name, label_name, hide=0):: self {
16+
addTemplate(name, metric_name, label_name, hide=0, allValue=null):: self {
1717
templating+: {
1818
list+: [{
19-
allValue: null,
19+
allValue: allValue,
2020
current: {
2121
text: 'prod',
2222
value: 'prod',
@@ -41,10 +41,10 @@
4141
},
4242
},
4343

44-
addMultiTemplate(name, metric_name, label_name, hide=0):: self {
44+
addMultiTemplate(name, metric_name, label_name, hide=0, allValue='.+'):: self {
4545
templating+: {
4646
list+: [{
47-
allValue: '.+',
47+
allValue: allValue,
4848
current: {
4949
selected: true,
5050
text: 'All',

0 commit comments

Comments
 (0)