Skip to content

Citus support#14

Open
pdeaudney wants to merge 7 commits intonbari:developfrom
pdeaudney:citus_support
Open

Citus support#14
pdeaudney wants to merge 7 commits intonbari:developfrom
pdeaudney:citus_support

Conversation

@pdeaudney
Copy link

@pdeaudney pdeaudney commented Feb 28, 2026

  • Have you test the code?
  • Have you check that the existing tests are passing?
  • The destination branch is develop?

Add citus support using test containers for Citus 12, 13 & 14.
Update local just file to allow Podman or Docker use locally.

pdeaudney and others added 2 commits February 28, 2026 21:24
Adds a new `citus` collector (disabled by default) that monitors Citus
distributed database statistics: worker nodes, distributed table sizes,
shard placement/sizes, connection stats, and distributed query activity.
Gracefully skips when Citus extension is not installed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nbari nbari self-requested a review February 28, 2026 16:24
Copy link
Owner

@nbari nbari left a comment

Choose a reason for hiding this comment

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

tests are not passing (cargo clippy --all-targets --all-features)

@nbari
Copy link
Owner

nbari commented Feb 28, 2026

Hi @pdeaudney, thanks for the PR, please check the formant / lint tests just test or cargo clippy --all-targets --all-features

pdeaudney and others added 2 commits March 1, 2026 09:32
- Rename res to response in add_trace_headers to fix similar_names lint
- Add #[must_use] to get_scraper and all_factories in register_macro
- Use assert!(..is_ok()) instead of .unwrap() in tests (project convention)
- Fix register_metrics span lifecycle: remove span.enter(), add drop(span)
- Use #[derive(Clone, Default)] matching other composite collectors
- Remove _total suffix from GaugeVec metrics (reserved for counters per Prometheus naming)
- Add graceful error handling to nodes.rs query matching other sub-collectors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only swallow errors when the specific view/table name appears in the
error message (indicating it doesn't exist on this Citus version).
All other errors (transient connection failures, timeouts, etc.) are
now propagated so they surface as failed scrapes rather than silently
producing empty metrics.

Matches the pattern used by archiver.rs and wal.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pdeaudney pdeaudney requested a review from nbari February 28, 2026 23:04
@nbari
Copy link
Owner

nbari commented Feb 28, 2026

Hi @pdeaudney, the format now is not passing

Copy link
Owner

@nbari nbari left a comment

Choose a reason for hiding this comment

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

run cargo fmt --all -- --check that should fix it, I later can take care of the integration tests

- Add explicit ::bigint, ::integer, ::double precision, ::text casts
  to all 9 Citus sub-collector queries for type safety
- Add metric finiteness and non-negativity verification to Citus
  integration tests
- Add empty-table edge-case test (extension only, no data)
- Update AGENTS.md to reflect Docker/Podman auto-detection
- Update CHANGELOG.md with all unreleased Citus changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pdeaudney
Copy link
Author

Have expanded on the integration tests a lot.
Corrected missing value casts as per instructions.
Added Citus 14 tests as the container got released a few hours ago.
Updated the justfile to work with Podman or Docker (not using podman here / local device is macOS with Docker desktop).
Added pg_stat_statements loading to the Citus contianer tests.
Run cargo fmt / installed just locally to use that.

@pdeaudney pdeaudney requested a review from nbari March 2, 2026 20:01
@nbari
Copy link
Owner

nbari commented Mar 2, 2026

Hi @pdeaudney looks good, but now sign/squash the commit to pass the flow

@nbari
Copy link
Owner

nbari commented Mar 3, 2026

@pdeaudney merge is blocked by the branch rule Commits must have verified signatures because GitHub checks every commit in this PR, not only the latest merge commit.

Right now these commits in the PR are unsigned:

  • ed65f97
  • 15ad0fe
  • a74b3c3
  • 45acd28
  • d681ef0

The two merge commits are verified, but that is not enough while the older commits remain unsigned.

To fix it, rewrite the PR branch with signed commits and force-push it. Typical flow from the PR branch:

git checkout citus_support
git fetch origin
git rebase origin/develop -i
# mark each PR commit for edit
# for each stopped commit:
git commit --amend -S --no-edit
git rebase --continue
# repeat until complete
git push --force-with-lease origin citus_support

If your Git signing is not configured yet, check first with:

git config --get commit.gpgsign
git config --get user.signingkey

After the rewritten branch is pushed, GitHub should clear the merge block once all commits in the PR show as verified.

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.

2 participants