Skip to content

Commit

Permalink
Merge pull request #1469 from ydb-platform/add-query-pool-index-metrics
Browse files Browse the repository at this point in the history
Added `ydb_go_sdk_ydb_query_pool_size_limit` metrics
  • Loading branch information
asmyasnikov authored Sep 18, 2024
2 parents 2b3958d + 8410fa9 commit f440187
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Added `ydb_go_sdk_ydb_query_pool_size_limit` metrics

## v3.80.7
* Doesn't rollback a the transaction on the operation error in table service

Expand Down
3 changes: 2 additions & 1 deletion metrics/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ func query(config Config) (t trace.Query) {
sizeConfig := poolConfig.WithSystem("size")
limit := sizeConfig.GaugeVec("limit")
idle := sizeConfig.GaugeVec("idle")

index := sizeConfig.GaugeVec("index")
t.OnPoolChange = func(stats trace.QueryPoolChange) {
if sizeConfig.Details()&trace.QueryPoolEvents == 0 {
return
}

limit.With(nil).Set(float64(stats.Limit))
idle.With(nil).Set(float64(stats.Idle))
index.With(nil).Set(float64(stats.Index))
}
}
}
Expand Down

0 comments on commit f440187

Please sign in to comment.