Skip to content

Postgres set pool size - #163

Merged
juanedi merged 2 commits into
trunkfrom
postgres-set-pool-size
Aug 25, 2026
Merged

Postgres set pool size#163
juanedi merged 2 commits into
trunkfrom
postgres-set-pool-size

Conversation

@juanedi

@juanedi juanedi commented Aug 24, 2026

Copy link
Copy Markdown
Member

Adds a way to override the pool size to be used in a Postgres.connection based on a Settings object.

Intended use case: use a small separate fixed-size pool for readiness checks, so these don't compete with requests for DB connections.

See https://noredink.slack.com/archives/C0ARKCTNLUE/p1787592700111799

Part of PDE-4.

Copilot AI lite review requested due to automatic review settings August 24, 2026 20:15
@linear

linear Bot commented Aug 24, 2026

Copy link
Copy Markdown

PDE-4

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a small API convenience to override the Postgres connection pool size in an existing Settings value (targeting use cases like readiness probes that should not contend with the main request pool), and publishes it as part of a new nri-postgresql release.

Changes:

  • Add Postgres.Settings.setPoolSize (re-exported as Postgres.setPoolSize) to override pool size and reset stripes to 1.
  • Add unit tests covering setPoolSize behavior.
  • Bump package version to 0.4.1.0 and update changelog + golden output to match.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
nri-postgresql/src/Postgres/Settings.hs Introduces setPoolSize and exports it from the Settings module.
nri-postgresql/src/Postgres.hs Re-exports setPoolSize from the public Postgres module API.
nri-postgresql/test/PostgresSettingsSpec.hs Adds a unit test ensuring setPoolSize updates size, resets stripes, and preserves other fields.
nri-postgresql/package.yaml Bumps package version to 0.4.1.0.
nri-postgresql/nri-postgresql.cabal Bumps cabal version to 0.4.1.0.
nri-postgresql/CHANGELOG.md Documents the new Postgres.setPoolSize API in a new release entry.
nri-postgresql/test/golden-results/observability-spec-postgres-reporting-ghc-9 Updates golden output for the new version string and shifted source locations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread nri-postgresql/src/Postgres/Settings.hs
@juanedi
juanedi requested review from omnibs and waj August 24, 2026 20:18

@omnibs omnibs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you for pushing this forward.

TIL stripes are a thing. Don't seem useful in our context so ok to hard code.

@juanedi
juanedi added this pull request to the merge queue Aug 25, 2026
Merged via the queue into trunk with commit 36830b0 Aug 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants