From fa86fe4b6ca7ba030d91099b0a684865d30779d3 Mon Sep 17 00:00:00 2001 From: Roman Golov Date: Fri, 13 Sep 2024 13:53:17 +0300 Subject: [PATCH] Split `ydb_go_sdk_ydb_driver_conn_requests` metrtcs metrics wer splitted to `ydb_go_sdk_ydb_driver_conn_request_methods` and `ydb_go_sdk_ydb_driver_conn_request_statuses` --- CHANGELOG.md | 1 + metrics/driver.go | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e85e0a28..df8ef0e32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Changed `ydb_go_sdk_ydb_driver_conn_requests` metrics splitted to `ydb_go_sdk_ydb_driver_conn_request_statuses` and `ydb_go_sdk_ydb_driver_conn_request_methods` * Fixed metadata for operation service connection * Fixed composing query traces in call `db.Query.Do[Tx]` using option `query.WithTrace` diff --git a/metrics/driver.go b/metrics/driver.go index b33da75b9..3c5e47736 100644 --- a/metrics/driver.go +++ b/metrics/driver.go @@ -18,7 +18,8 @@ func driver(config Config) (t trace.Driver) { balancerUpdates := config.WithSystem("balancer").CounterVec("updates", "cause") conns := config.GaugeVec("conns", "endpoint", "node_id") banned := config.WithSystem("conn").GaugeVec("banned", "endpoint", "node_id", "cause") - requests := config.WithSystem("conn").CounterVec("requests", "status", "method", "endpoint", "node_id") + requestStatuses := config.WithSystem("conn").CounterVec("request_statuses", "status", "endpoint", "node_id") + requestMethods := config.WithSystem("conn").CounterVec("request_methods", "method", "endpoint", "node_id") tli := config.CounterVec("transaction_locks_invalidated") type endpointKey struct { @@ -35,8 +36,12 @@ func driver(config Config) (t trace.Driver) { return func(info trace.DriverConnInvokeDoneInfo) { if config.Details()&trace.DriverConnEvents != 0 { - requests.With(map[string]string{ + requestStatuses.With(map[string]string{ "status": errorBrief(info.Error), + "endpoint": endpoint, + "node_id": strconv.FormatUint(uint64(nodeID), 10), + }).Inc() + requestMethods.With(map[string]string{ "method": string(method), "endpoint": endpoint, "node_id": strconv.FormatUint(uint64(nodeID), 10), @@ -58,7 +63,7 @@ func driver(config Config) (t trace.Driver) { return func(info trace.DriverConnNewStreamDoneInfo) { if config.Details()&trace.DriverConnStreamEvents != 0 { - requests.With(map[string]string{ + requestStatuses.With(map[string]string{ "status": errorBrief(info.Error), "method": string(method), "endpoint": endpoint,