Skip to content

Commit

Permalink
Fix cluster query
Browse files Browse the repository at this point in the history
Fix mixin cluster parameter otherwise generated mixins looks like this:

```json
{"type":"prometheus","uid":"${datasource}"},"label":"cluster","name":"job","query":"label_values(etcd_server_has_leader{job=~\".*etcd.*\"}, job)","refresh":2,"type":"query"}]},"time":{"from":"now-15m","to":"now"},"timezone": "`}}{{ .Values.grafana.defaultDashboardsTimezone }}{{`","title":"etcd","uid":"c2f4e12cdf69feb95caa41a5a1b423d9"}`}}
```

where name is job when the variable name used in dashboard queries is cluster.
  • Loading branch information
QuentinBisson authored Oct 16, 2023
1 parent 252f5a6 commit 86ce12c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/mixin/dashboards/variables.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function(config) {
+ var.datasource.generalOptions.withLabel('Data Source'),

cluster:
var.query.new(config.clusterLabel)
var.query.new('cluster')
+ var.query.generalOptions.withLabel('cluster')
+ var.query.withDatasourceFromVariable(self.datasource)
+ { refresh: config.dashboard_var_refresh }
Expand Down

0 comments on commit 86ce12c

Please sign in to comment.