From 4c6909fb91b1da4f538e211d6a8e7be35de417c2 Mon Sep 17 00:00:00 2001 From: Marcelo Costa Date: Wed, 12 Apr 2023 17:11:21 -0500 Subject: [PATCH 1/2] Add maxDataPoints to the Table panel --- grafonnet/table_panel.libsonnet | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grafonnet/table_panel.libsonnet b/grafonnet/table_panel.libsonnet index 4c686b3d..17ac1d63 100644 --- a/grafonnet/table_panel.libsonnet +++ b/grafonnet/table_panel.libsonnet @@ -39,6 +39,7 @@ transparent=false, columns=[], sort=null, + max_data_points=null, time_from=null, time_shift=null, links=[], @@ -53,6 +54,7 @@ ], styles: styles, columns: columns, + maxDataPoints: max_data_points, timeFrom: time_from, timeShift: time_shift, links: links, From 084f64308a3ffeb838e285e89f16c19c8a71f8b2 Mon Sep 17 00:00:00 2001 From: Marcelo Costa Date: Wed, 12 Apr 2023 17:15:14 -0500 Subject: [PATCH 2/2] tweak param definition --- grafonnet/table_panel.libsonnet | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grafonnet/table_panel.libsonnet b/grafonnet/table_panel.libsonnet index 17ac1d63..7a9bbca2 100644 --- a/grafonnet/table_panel.libsonnet +++ b/grafonnet/table_panel.libsonnet @@ -12,6 +12,7 @@ * @param datasource (optional) Datasource * @param min_span (optional) Min span * @param styles (optional) Array of styles for the panel + * @param maxDataPoints (optional) If the data source supports it, sets the maximum number of data points for each series returned * @param columns (optional) Array of columns for the panel * @param sort (optional) Sorting instruction for the panel * @param transform (optional) Allow table manipulation to present data as desired @@ -39,7 +40,7 @@ transparent=false, columns=[], sort=null, - max_data_points=null, + maxDataPoints=null, time_from=null, time_shift=null, links=[], @@ -54,7 +55,7 @@ ], styles: styles, columns: columns, - maxDataPoints: max_data_points, + [if maxDataPoints != null then 'maxDataPoints']: maxDataPoints, timeFrom: time_from, timeShift: time_shift, links: links,