Skip to content

Commit

Permalink
Merge pull request #1496 from ydb-platform/fix_query_session_count_me…
Browse files Browse the repository at this point in the history
…trics

Do not report `query_session_count` metrics when metrics are disabled
  • Loading branch information
asmyasnikov authored Oct 2, 2024
2 parents d7525b8 + d5b856c commit e43e5e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Disabled reporting of `ydb_go_sdk_ydb_query_session_create_latency histogram metrics` when metrics are disabled
* Disabled reporting of `ydb_go_sdk_query_session_count` when metrics are disabled
* 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
Expand Down
3 changes: 1 addition & 2 deletions metrics/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,11 @@ func query(config Config) (t trace.Query) {
errs := deleteConfig.CounterVec("errs", "status")
latency := deleteConfig.TimerVec("latency")
t.OnSessionDelete = func(info trace.QuerySessionDeleteStartInfo) func(info trace.QuerySessionDeleteDoneInfo) {
count.With(nil).Add(-1)

start := time.Now()

return func(info trace.QuerySessionDeleteDoneInfo) {
if deleteConfig.Details()&trace.QuerySessionEvents != 0 {
count.With(nil).Add(-1)
errs.With(map[string]string{
"status": errorBrief(info.Error),
}).Inc()
Expand Down

0 comments on commit e43e5e5

Please sign in to comment.