From 0b778c81d6d6f019af8fae1068d0c2a38ac91e8a Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Sat, 6 Apr 2024 09:06:51 +0530 Subject: [PATCH] mgr/dashboard: add Table Schema to grafonnet Backport of #56509 in reef didn't include the Table Schema in the utils.libsonnet because of which the json generation ias failing. This PR tends to add the Table Schema Signed-off-by: Aashish Sharma --- .../ceph-mixin/dashboards/utils.libsonnet | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/monitoring/ceph-mixin/dashboards/utils.libsonnet b/monitoring/ceph-mixin/dashboards/utils.libsonnet index 739db82976ebe..5575d62052982 100644 --- a/monitoring/ceph-mixin/dashboards/utils.libsonnet +++ b/monitoring/ceph-mixin/dashboards/utils.libsonnet @@ -356,4 +356,43 @@ local pieChartPanel = import 'piechart_panel.libsonnet'; overrides=overrides, reduceOptions=reduceOptions, ), + + addTableExtended( + title='', + datasource=null, + description=null, + sort=null, + styles='', + transform=null, + pluginVersion='9.1.3', + options=null, + gridPosition={}, + custom=null, + decimals=null, + thresholds=null, + unit=null, + overrides=[], + color=null + ):: + g.tablePanel.new(datasource=datasource, + description=description, + sort=sort, + styles=styles, + title=title, + transform=transform) + { + pluginVersion: pluginVersion, + gridPos: gridPosition, + [if options != null then 'options']: options, + fieldConfig+: { + defaults+: { + [if custom != null then 'custom']: custom, + [if decimals != null then 'decimals']: decimals, + [if thresholds != null then 'thresholds']: thresholds, + [if unit != null then 'unit']: unit, + [if color != null then 'color']: color, + + }, + overrides: overrides, + }, + }, } -- 2.39.5