feat: add experimental CockroachDB diagnostics - #27
Closed
srosenberg wants to merge 1 commit into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Add experimental, native CockroachDB diagnostics to pgbot while preserving the existing PostgreSQL behavior and graceful-degradation model.
The integration detects CockroachDB over pgwire and adds engine-aware collection for:
health,distribution,storage,jobs,activity, andcontentionscreensComprehensive cluster health combines read-only SQL with the CockroachDB Admin API and Prometheus load endpoint. Collectors remain bounded and explicitly mark unavailable or partial data.
The optional AI layer now receives a compact, CockroachDB-aware diagnostic summary without raw SQL, localities, users, application names, or job descriptions. OpenAI requests also handle models such as
gpt-5.6-solthat reject non-default temperature values.Public contract and safety
1.2.0to1.3.0; the generated schema is included.EXPLAIN ANALYZE.Validation
scripts/gate.shpasses: clean-HEAD build, vet, tests, and builds for four architecturesgo test -race ./...passesgofmt -l .is cleango run ./tools/schemagenChecklist
scripts/gate.shpasses (builds HEAD, not just the working tree)EXPLAIN ANALYZE; findings stay deterministic (computed in Go)model.Context/--json/ the store--jsonchange is additive,model.SchemaVersionis bumped, and the schema is regenerateddocs/findings/<id>.mdpage and catalog entry