@@ -155,6 +155,23 @@ func reportPoolStats(rdb *redis.Client, conf *config) (metric.Registration, erro
155
155
return nil , err
156
156
}
157
157
158
+ waits , err := conf .meter .Int64ObservableUpDownCounter (
159
+ "db.client.connections.waits" ,
160
+ metric .WithDescription ("The number of times a connection was waited for" ),
161
+ )
162
+ if err != nil {
163
+ return nil , err
164
+ }
165
+
166
+ waitsDuration , err := conf .meter .Int64ObservableUpDownCounter (
167
+ "db.client.connections.waits_duration" ,
168
+ metric .WithDescription ("The total time spent for waiting a connection in nanoseconds" ),
169
+ metric .WithUnit ("ns" ),
170
+ )
171
+ if err != nil {
172
+ return nil , err
173
+ }
174
+
158
175
timeouts , err := conf .meter .Int64ObservableUpDownCounter (
159
176
"db.client.connections.timeouts" ,
160
177
metric .WithDescription ("The number of connection timeouts that have occurred trying to obtain a connection from the pool" ),
@@ -191,6 +208,9 @@ func reportPoolStats(rdb *redis.Client, conf *config) (metric.Registration, erro
191
208
o .ObserveInt64 (usage , int64 (stats .IdleConns ), metric .WithAttributeSet (idleAttrs ))
192
209
o .ObserveInt64 (usage , int64 (stats .TotalConns - stats .IdleConns ), metric .WithAttributeSet (usedAttrs ))
193
210
211
+ o .ObserveInt64 (waits , int64 (stats .WaitCount ), metric .WithAttributeSet (poolAttrs ))
212
+ o .ObserveInt64 (waitsDuration , stats .WaitDurationNs , metric .WithAttributeSet (poolAttrs ))
213
+
194
214
o .ObserveInt64 (timeouts , int64 (stats .Timeouts ), metric .WithAttributeSet (poolAttrs ))
195
215
o .ObserveInt64 (hits , int64 (stats .Hits ), metric .WithAttributeSet (poolAttrs ))
196
216
o .ObserveInt64 (misses , int64 (stats .Misses ), metric .WithAttributeSet (poolAttrs ))
0 commit comments