Skip to content

Commit 333cecc

Browse files
authored
Add support for dashboards datasource filter (#2560)
This commit add support for dashboards datasource filter using a regex named 'datasource_regex' provided in the config.libsonnet file. It's done in a similar way than for grafana/mimir. Signed-off-by: julien.girard <[email protected]>
1 parent 55440f9 commit 333cecc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

operations/pyroscope/jsonnet/pyroscope-mixin/pyroscope-mixin/config.libsonnet

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414
// Add the mixin with support for multiple cluster
1515
multi_cluster: true,
1616

17+
// Regex used to filter proposed datasources
18+
datasource_regex: '',
1719
},
1820
}

operations/pyroscope/jsonnet/pyroscope-mixin/pyroscope-mixin/dashboards/dashboard-utils.libsonnet

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ local utils = import 'mixin-utils/utils.libsonnet';
55
// - default tags,
66
// - some links that propagate the selected cluster.
77
dashboard(title, uid='')::
8-
super.dashboard(title, uid) + {
8+
super.dashboard(
9+
title,
10+
uid,
11+
datasource_regex=$._config.datasource_regex
12+
) + {
913
addRowIf(condition, row)::
1014
if condition
1115
then self.addRow(row)

0 commit comments

Comments
 (0)