Skip to content

Commit

Permalink
Tenant Dashboard: Use natural sort for "user" variable (#9408)
Browse files Browse the repository at this point in the history
So instead of getting `11000, 100000, 9000, struser`, we'll get `9000, 11000, 100000, struser`
  • Loading branch information
julienduchesne authored Sep 25, 2024
1 parent bc8fe0b commit 09719b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35250,7 +35250,7 @@ data:
"query": "label_values(cortex_ingester_active_series{cluster=~\"$cluster\", namespace=~\"$namespace\"}, user)",
"refresh": 1,
"regex": "",
"sort": 1,
"sort": 7,
"tagValuesQuery": "",
"tags": [ ],
"tagsQuery": "",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion operations/mimir-mixin/dashboards/dashboard-utils.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
]),

local sortAscending = 1,
local sortNaturalAscending = 7,

_config:: error 'must provide _config',

Expand Down Expand Up @@ -124,7 +125,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
.addTemplate('namespace', $._config.dashboard_variables.namespace_query, '%s' % $._config.per_namespace_label, sort=sortAscending),

addActiveUserSelectorTemplates()::
self.addTemplate('user', 'cortex_ingester_active_series{%s=~"$cluster", %s=~"$namespace"}' % [$._config.per_cluster_label, $._config.per_namespace_label], 'user', sort=sortAscending),
self.addTemplate('user', 'cortex_ingester_active_series{%s=~"$cluster", %s=~"$namespace"}' % [$._config.per_cluster_label, $._config.per_namespace_label], 'user', sort=sortNaturalAscending),

addCustomTemplate(label, name, options, defaultIndex=0):: self {
// Escape the comma because it's used a separator in the options list.
Expand Down

0 comments on commit 09719b5

Please sign in to comment.