Skip to content

Conversation

@Adi-Goll
Copy link

@Adi-Goll Adi-Goll commented Feb 2, 2026

This PR adds three new metrics in response to issue #724:

  • max_connections
  • prepared_statements_limit
  • query_cache_limit

This corresponds to the following sample pgdog.toml:

[general]
openmetrics_port = 9090
prepared_statements_limit = 123
query_cache_limit = 456
default_pool_size = 70

[[databases]]
name = "mydb"
host = "127.0.0.1"
port = 5432
shard = 0

This produces the following output when metrics are displayed.

# TYPE max_connections gauge
# HELP max_connections Maximum number of server connections allowed for a pool
max_connections{user="ubuntu",database="mydb",host="127.0.0.1",port="5432",shard="0",role="primary"} 70

# TYPE prepared_statements_limit gauge
# HELP prepared_statements_limit Maximum number of prepared statements that are cached
prepared_statements_limit{user="ubuntu",database="mydb",host="127.0.0.1",port="5432",shard="0",role="primary"} 123

# TYPE query_cache_limit gauge
# HELP query_cache_limit Maximum number of queries stored in cache
query_cache_limit{user="ubuntu",database="mydb",host="127.0.0.1",port="5432",shard="0",role="primary"} 456

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 0% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/stats/pools.rs 0.00% 41 Missing ⚠️

📢 Thoughts on this report? Let us know!

Modify src/stats/pools.rs to include
new metrics that exposes the red line
for connections (max_connections),
the max prepared statements in cache
(prepared_statements_limit) as well as
the max queries stored in cache
(query_cache_limit).

```
\# TYPE max_connections gauge
\# HELP max_connections Maximum number of server connections allowed for a pool
max_connections{user="ubuntu",database="mydb",host="127.0.0.1",port="5432",shard="0",role="primary"} 70

\# TYPE prepared_statements_limit gauge
\# HELP prepared_statements_limit Maximum number of prepared statements that are cached
prepared_statements_limit{user="ubuntu",database="mydb",host="127.0.0.1",port="5432",shard="0",role="primary"} 123

\# TYPE query_cache_limit gauge
\# HELP query_cache_limit Maximum number of queries stored in cache
query_cache_limit{user="ubuntu",database="mydb",host="127.0.0.1",port="5432",shard="0",role="primary"} 456

```

Signed-off-by: Aditya Gollamudi <adigollamudi@gmail.com>
@Adi-Goll Adi-Goll force-pushed the adigoll-expose-settings-as-metrics branch from 93b24f0 to 7dda90a Compare February 2, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants