From 0618da7d44246425c2837cccb2c054bc0cb47998 Mon Sep 17 00:00:00 2001 From: Charles Korn Date: Wed, 12 Jul 2023 09:11:10 +1000 Subject: [PATCH] Allow configuring sort order for variables (#1014) --- grafana-builder/grafana.libsonnet | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grafana-builder/grafana.libsonnet b/grafana-builder/grafana.libsonnet index f2d60d404..a3342878c 100644 --- a/grafana-builder/grafana.libsonnet +++ b/grafana-builder/grafana.libsonnet @@ -13,7 +13,7 @@ rows+: [row { panels: panels }], }, - addTemplate(name, metric_name, label_name, hide=0, allValue=null, includeAll=false):: self { + addTemplate(name, metric_name, label_name, hide=0, allValue=null, includeAll=false, sort=2):: self { templating+: { list+: [{ allValue: allValue, @@ -31,7 +31,7 @@ query: 'label_values(%s, %s)' % [metric_name, label_name], refresh: 1, regex: '', - sort: 2, + sort: sort, tagValuesQuery: '', tags: [], tagsQuery: '', @@ -41,7 +41,7 @@ }, }, - addMultiTemplate(name, metric_name, label_name, hide=0, allValue='.+'):: self { + addMultiTemplate(name, metric_name, label_name, hide=0, allValue='.+', sort=2):: self { templating+: { list+: [{ allValue: allValue, @@ -60,7 +60,7 @@ query: 'label_values(%s, %s)' % [metric_name, label_name], refresh: 1, regex: '', - sort: 2, + sort: sort, tagValuesQuery: '', tags: [], tagsQuery: '',