Skip to content

fix: pool metrics + YAML pool config (#114, #115)#116

Merged
cbaugus merged 2 commits intomainfrom
fix/pool-metrics-and-yaml-config
Apr 13, 2026
Merged

fix: pool metrics + YAML pool config (#114, #115)#116
cbaugus merged 2 commits intomainfrom
fix/pool-metrics-and-yaml-config

Conversation

@cbaugus
Copy link
Copy Markdown
Owner

@cbaugus cbaugus commented Apr 13, 2026

Summary

config:
  pool:
    maxIdlePerHost: 0      # 0 = new connection per request
    idleTimeoutSecs: 0     # 0 = close idle connections immediately

Test plan

  • CI passes (build + existing tests)
  • Deploy dev build, run a load test, verify connection_pool_reuse_rate_percent is non-zero in Prometheus
  • POST a YAML config with pool: { maxIdlePerHost: 0, idleTimeoutSecs: 0 } and verify connection_pool_likely_new_total climbs (no reuse)
  • POST a YAML config without pool section and verify connections are reused (env-var defaults)

Closes #114

🤖 Generated with Claude Code

cbaugus and others added 2 commits April 13, 2026 12:34
…#114, #115)

The pool Prometheus counters (connection_pool_likely_new_total,
connection_pool_likely_reused_total, connection_pool_reuse_rate_percent)
were registered but never incremented — always reported 0. Now
record_request() updates them alongside the in-memory stats.

Also adds an optional `pool` section to the YAML config so pool
behavior (maxIdlePerHost, idleTimeoutSecs) can be controlled per-test
via POST /config without restarting the process.

Closes #114

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cbaugus cbaugus merged commit 7eb8122 into main Apr 13, 2026
6 checks passed
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.

Bug: Connection pool Prometheus metrics never updated

1 participant