Repository navigation
feat(checkers): ClickHouse health checks over the native protocol - #203
Merged
Merged
Conversation
Adds a `clickhouse` check type built on the native (binary) protocol via clickhouse-go/v2, not the HTTP interface, so the check exercises the same transport analytics clients use. Config: host, port (9000, or 9440 when `secure`), username (defaults to ClickHouse's own `default` user), password (encrypted at rest), database, secure, tls_verify, timeout, query. Ping then query; the result renders the first cell from the column's own scan type, since the native protocol is strictly typed and `SELECT 1` arrives as a UInt8 rather than text. Reports server_version plus connection/query/total timings, and dials through an SSH bastion when the check carries a tunnelCheckUid. Its own dashboard module rather than a member of sqlDatabaseModule: the TLS toggle moves the default port, which the shared SQL fields have no notion of. Docs and the check-type tally move from 38 to 39.
Owner
|
LGTM, thank you @WeshGuillaume for this contribution ! |
fclairamb
enabled auto-merge (squash)
August 8, 2026 15:49
…e checker Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
fclairamb
added a commit
that referenced
this pull request
Aug 8, 2026
🤖 I have created a release *beep* *boop* --- ## [0.10.0](v0.9.0...v0.10.0) (2026-08-08) ### Features * **checkers:** ClickHouse health checks over the native protocol ([#203](#203)) ([57d6f67](57d6f67)) ### Bug Fixes * **deps:** update dependency motion to v13 ([#202](#202)) ([5425dcf](5425dcf)) * **deps:** update github.com/dop251/goja digest to 493f220 ([#200](#200)) ([d029a09](d029a09)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This was referenced Sep 8, 2026
Closed
Closed
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.
Adds a
clickhousecheck type, bringing the customer-facing tally from 38 to 39.What
A native-protocol ClickHouse checker built on
clickhouse-go/v2— the binary protocol on 9000/9440, not the HTTP interface on 8123 — so the check exercises the same transport analytics clients actually use.Config:
host,port(9000, or 9440 whensecure),username(defaults to ClickHouse's owndefaultuser),password(declared secret, encrypted at rest),database(defaults todefault),secure,tls_verify,timeout(max 30s),query(must start withSELECT).Execution: ping, then run the query and report its first cell. Output carries
server_version,host,port,database,secure; metrics areconnection_time_ms/query_time_ms/total_time_ms. Ping failure →down, deadline →timeout, client construction failure →error. Dials through an SSH bastion when the check carries atunnelCheckUid(SupportsTunnel: true).Why these choices
SELECT 1arrives as a UInt8, not text, so scanning into astringfails. Destinations are allocated from each column's ownScanType()and rendered via reflection, rather than assuming a string like thedatabase/sql-based siblings can.usernameis optional. Postgres/MySQL require it; ClickHouse ships with adefaultuser, so defaulting is more correct than forcing operators to typedefault.securemoves the default port (9000 → 9440), matching ClickHouse Cloud, which is TLS-only.tls_verifyrequiressecureand is rejected otherwise.sqlDatabaseModule: the TLS toggle shifts the default port, which the shared SQL fields have no notion of.tunneled) instead of collapsing to an error string. For a tunneled check, knowing the probe crossed a bastion is exactly what makes a failure actionable.Testing
Unit tests cover
FromMaptype errors,Validatebounds and thetls_verify/securepairing,GetConfiground-trip and default omission, name/slug autofill, sample validity, and the down/timeout classification against a real listener. Tunnel tests assert the verbatimhost:portcrosses the bastion (an RFC 2606.invalidhost proves local resolution was skipped) and thatsecurereaches 9440 on the wire.Verified against a live ClickHouse 26.1.3:
SELECT 1up, result1,server_version=26.1.3SELECT version()up, result26.1.3.52SELECT count() FROM system.partsup, result577down,code: 516 … Authentication failedNotes for reviewers
FromMapis a loop over field tables rather than the siblings'if v, ok := m["x"].(string)wall (which needs a//nolint:cyclop); resolution usesresolved*()methods on the config instead of anexecParamsstruct; and onefailure()helper replaces the duplicatedhandlePingError/handleQueryErrorpair.config.go/configmap.go,checker.go/scan.go/result.go) to stay under 200 lines each.golangci-lintwas not available on my machine, somake lint-backdid not run —gofmtandgo vetare clean. dash0 lint/typecheck baseline is unchanged (identical counts before and after).check-types.md,intro.md,ssh-tunnels.md,README.md,wiki/conventions/checker-config.md,wiki/architecture.md.🤖 Generated with Claude Code