From 7153a839261942a43f76182679d557a90ee8f6f1 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Fri, 6 May 2022 12:43:46 +0300 Subject: [PATCH] Fix data processing when trend data fetched from DB, closes #1445 --- pkg/datasource/zabbix.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/datasource/zabbix.go b/pkg/datasource/zabbix.go index 23ab529..7afb908 100644 --- a/pkg/datasource/zabbix.go +++ b/pkg/datasource/zabbix.go @@ -118,10 +118,13 @@ func (ds *ZabbixDatasourceInstance) applyDataProcessing(ctx context.Context, que // Align time series data if possible disableDataAlignment := query.Options.DisableDataAlignment || ds.Settings.DisableDataAlignment || query.QueryType == MODE_ITSERVICE if !disableDataAlignment { - if useTrend && !DBPostProcessing { - for _, s := range series { - // Trend data is already aligned (by 1 hour interval), but null values should be added - s.TS = s.TS.FillTrendWithNulls() + if useTrend { + // Skip if data fetched directly from DB (it already contains nulls) + if !DBPostProcessing { + for _, s := range series { + // Trend data is already aligned (by 1 hour interval), but null values should be added + s.TS = s.TS.FillTrendWithNulls() + } } } else { for _, s := range series {