sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.05k stars 983 forks source link

Fix value on first fetch for connpool prometheus metrics #4620

Closed JavierJF closed 3 months ago

JavierJF commented 3 months ago

This PR fixes a minor inaccuracy present in the first fetch performed to connection pool prometheus metrics. The initial value for metrics using p_update_connection_pool_update_* helpers were missing.

This only affects to the first metrics fetch, during the metric creation on the internal maps, subsequent fetches will find the already created metric and updated the value properly. As real counters are internal, this doesn't affect the correctness of the value in subsequent fetches.

The PR also improves prometheus metrics test with new checks for these metrics.