From d4f774f36ffdf8aaab75e2bca1f4a9edcf022192 Mon Sep 17 00:00:00 2001 From: mrproliu <741550557@qq.com> Date: Wed, 29 Nov 2023 13:55:02 +0800 Subject: [PATCH] Fix the record list query does not support new OAP versions (#197) --- CHANGES.md | 5 +++++ internal/commands/metrics/aggregation/sampled-record.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 42bc400..8520a3e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,11 @@ Release Notes. ------------------ ### Features + +### Bug Fixes + +* Fix the record list query does not support new OAP versions (with major version number > 9). + ## What's Changed * Add the sub-command `menu get` for get the ui menu items by @mrproliu in https://github.com/apache/skywalking-cli/pull/187 diff --git a/internal/commands/metrics/aggregation/sampled-record.go b/internal/commands/metrics/aggregation/sampled-record.go index 3745de7..4f26881 100644 --- a/internal/commands/metrics/aggregation/sampled-record.go +++ b/internal/commands/metrics/aggregation/sampled-record.go @@ -76,7 +76,7 @@ $ swctl metrics sampled-record --name top_n_database_statement 5 } // since 9.3.0, use new record query API - if major >= 9 && minor >= 3 { + if (major == 9 && minor >= 3) || major > 9 { condition, duration, err1 := buildReadRecordsCondition(ctx) if err1 != nil { return err1