From b617ed7fad7cf28092858182c9894264d9de78e2 Mon Sep 17 00:00:00 2001 From: Mikhail Alpinskiy Date: Wed, 15 Jan 2025 13:14:47 +0300 Subject: [PATCH] API ensure timescale step >= metric resolution --- internal/data_model/timescale.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/data_model/timescale.go b/internal/data_model/timescale.go index 64d812f59..785cea9af 100644 --- a/internal/data_model/timescale.go +++ b/internal/data_model/timescale.go @@ -322,14 +322,10 @@ func GetTimescale(args GetTimescaleArgs) (Timescale, error) { // generate LODs var minStep int64 pointQuery := args.Mode == PointQuery - if pointQuery { + if pointQuery || args.Step < maxMetricRes { minStep = maxMetricRes } else { - if 0 < args.Step { - minStep = args.Step - } else { - minStep = maxMetricRes - } + minStep = args.Step } start := args.Start - int64(maxOffset) end := args.End - int64(maxOffset)