github.com/thanos-io/thanos@v0.32.5/mixin/dashboards/overview.libsonnet (about) 1 local g = import '../lib/thanos-grafana-builder/builder.libsonnet'; 2 3 { 4 local thanos = self, 5 overview:: { 6 title: error 'must provide title for Thanos Overview dashboard', 7 }, 8 grafanaDashboards+:: { 9 'overview.json': 10 g.dashboard(thanos.dashboard.overview.title), 11 }, 12 } + 13 { 14 local grafanaDashboards = super.grafanaDashboards, 15 grafanaDashboards+:: { 16 'overview.json'+: { 17 __enumeratedRows__+:: std.foldl( 18 function(acc, row) 19 local n = std.length(row.panels); 20 local panelIndex = acc.counter; 21 local panels = std.makeArray( 22 n, function(i) 23 row.panels[i] { id: panelIndex + i } 24 ); 25 acc { counter:: acc.counter + n, rows+: [row { panels: panels }] }, 26 grafanaDashboards.__overviewRows__, 27 { counter:: 1, rows: [] } 28 ), 29 30 rows+: self.__enumeratedRows__.rows, 31 }, 32 }, 33 }