add(metrics): expose db pool flushes counter#4658
add(metrics): expose db pool flushes counter#4658mkleczek wants to merge 1 commit intoPostgREST:mainfrom
Conversation
bd4435f to
bdb52e7
Compare
38ebc23 to
4e007c2
Compare
| **Type** Counter | ||
| ======== ======= | ||
|
|
||
| The total number of times the pool was flushed. |
There was a problem hiding this comment.
Maybe we should mention this means releasing all the connections in the pool, which always happens during schema cache load?
There was a problem hiding this comment.
which always happens during schema cache load?
Hm, actually I'm not sure if the above will be true once #4645 is merged
There was a problem hiding this comment.
which always happens during schema cache load?
Hm, actually I'm not sure if the above will be true once #4645 is merged
@steve-chavez Added a short sentence to the documentation.
8755576 to
a323d91
Compare
Emit a dedicated PoolFlushed observation when the DB pool is released during schema cache reload and expose it as pgrst_db_pool_flushes_total.
a323d91 to
e771d73
Compare
|
One question, would this be generally useful? I mean besides for testing #4645. I haven't seen this metric on OTel db metrics although I have seen numDestroys in some other place (not sure if these are Prom metrics). |
|
If not generally useful, maybe this metric can be private and not exposed to users? That way we can use it for tests only. |
@steve-chavez I agree. There is no need for this metric, only observation. |
Emit a dedicated PoolFlushed observation when the DB pool is released during schema cache reload and expose it as
pgrst_db_pool_flushes_total.Stacked on top of #4659 to make tests more readable