From 4e055be604450e38c71d8318a495aaba3cdc96e6 Mon Sep 17 00:00:00 2001 From: Roman Golov Date: Wed, 2 Oct 2024 19:21:53 +0300 Subject: [PATCH] Do not report latency metrics whem metrics are disabled --- CHANGELOG.md | 1 + metrics/query.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0e417b55..700bd7007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Disabled reporting of `ydb_go_sdk_ydb_query_session_create_latency histogram metrics` when metrics are disabled * Allowed skip column for `ScanStruct` by tag `-` ## v3.81.4 diff --git a/metrics/query.go b/metrics/query.go index d8a849adc..78acde2c3 100644 --- a/metrics/query.go +++ b/metrics/query.go @@ -124,8 +124,8 @@ func query(config Config) (t trace.Query) { errs.With(map[string]string{ "status": errorBrief(info.Error), }).Inc() + latency.With(nil).Record(time.Since(start)) } - latency.With(nil).Record(time.Since(start)) } } }