From 62d6ecb64a1545c6e2364c5244b1043426a8c005 Mon Sep 17 00:00:00 2001 From: v-zhuravlev Date: Mon, 20 Oct 2025 15:03:32 +0300 Subject: [PATCH] Update labelsToPanelLegend --- common-lib/CHANGELOG.md | 3 +++ common-lib/common/utils.libsonnet | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common-lib/CHANGELOG.md b/common-lib/CHANGELOG.md index 9774efde5..e6148d455 100644 --- a/common-lib/CHANGELOG.md +++ b/common-lib/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.4.1 +- [Utils] Add optional separator='/' attribute to labelsToPanelLegend. + # 0.4.0 - [Signal] Add defaultSignalSource param to set default signal source. diff --git a/common-lib/common/utils.libsonnet b/common-lib/common/utils.libsonnet index 17b4c0be8..0272dd93e 100644 --- a/common-lib/common/utils.libsonnet +++ b/common-lib/common/utils.libsonnet @@ -10,7 +10,7 @@ labelsToPromQLSelectorAdvanced(labels): std.join(',', ['%s=~"${%s:regex}"' % [label, label] for label in labels]), labelsToLogQLSelectorAdvanced: self.labelsToPromQLSelectorAdvanced, - labelsToPanelLegend(labels): std.join('/', ['{{%s}}' % [label] for label in labels]), + labelsToPanelLegend(labels, separator='/'): std.join(separator, ['{{%s}}' % [label] for label in labels]), toSentenceCase(string):: std.asciiUpper(string[0]) + std.slice(string, 1, std.length(string), 1),