Repository navigation
feat: TC-4464 node health telemetry and named sqlx pool warnings - #770
Merged
Merged
Conversation
samgbafa
force-pushed
the
skgbafa/tc-4464-node-health-telemetry
branch
from
November 28, 2026 22:29
5366780 to
8b8b4d2
Compare
- node_health: one `node health` line a minute (CPU user/sys delta, RSS, tokio, in-flight, DB pool state and acquire counters) and one `node job health` line per background job that ran; counts and durations only. - vendored sqlx-core: Pool::acquire_stats()/take_acquire_wait_max(); the tx-release and slow-acquire warnings log on tinycloud_core::db_pool (sqlx* targets were dropped in-process). - log shipper: node_health/node_job_health events validated key by key; db_pool_closed_in_transaction and db_pool_acquire_slow codes; canonical schema pin bd108145 (tinycloud-dev-sam#393). - compose: regenerated VECTOR_CONFIG_JSON; N0 template hash 5a7bcad6… (raw 7675e6a1…). Linear: TC-4464
samgbafa
force-pushed
the
skgbafa/tc-4464-node-health-telemetry
branch
from
November 28, 2026 22:58
8b8b4d2 to
508807a
Compare
Contributor
Author
|
Rebased onto a0e2ddc (#769, TC-4466). Its cloudflared Note for #606 (TC-3006): it is left untouched. If it lands after this PR, it must reconcile with it. Here the tx-release warning already logs on |
…health ticks - node_health::bounded: a timed pass succeeds only on Ok(Ok(_)); artifact_parts used the outer timeout result, so an inner reap error counted as a success. - The node-health interval uses MissedTickBehavior::Delay, so a stall does not emit back-to-back rows with interval_ms near 0. Linear: TC-4464
…#393 squash) - fields.json bytes unchanged (sha256 86312cc2…); revision only. Linear: TC-4464
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.
Linear: TC-4464. Canonical schema: TinyCloudLabs/tinycloud-dev-sam#393, merged as squash
69964051eaf7e8a0433c4deed3174450314d7730.log-shipper/canonical.jsonpins that commit; thefields.jsonbytes are unchanged (sha25686312cc2…).Review fixes (Bobbie):
node_health::boundedmakes a timedartifact_partspass succeed only onOk(Ok(_)), so a failed reap now counts as a failure (new unit test). The node-health interval usesMissedTickBehavior::Delay.Since ~18:35Z 2026-11-28 prod
/invokeruns 5–10x slower and CPU, pool state and job timings are not visible. This adds a fixed-rate health line and names the sqlx pool warnings.Node
node_health.rs: once a minute (tinycloud::node_health),node healthwith 21 integer fields: interval, process CPU user/sys ms (getrusage delta), RSS, tokio workers/tasks/global queue/busy ms, in-flight requests now and max in the minute, pool max/size/idle/in_use/waiting, and since the last line pool acquired/timed_out/cancelled/failed, total and longest acquire wait.node job healthline per job that has run:job(artifact_parts,renewal,replay_cleanup,kv_orphans,retention,webhook_dispatch), runs, failures, last_ms, max_ms, running_ms.local_cache(dropped with the request).Vendored sqlx (
vendor/sqlx-core/PATCH.md)Pool::acquire_stats()/Pool::take_acquire_wait_max(): per-pool counters for each acquisition outcome, waiters and wait time.tinycloud_core::db_pool. Before,may_be_loggeddropped everysqlx*target in-process, so neither line was ever written. Thesqlx*filter is unchanged.Log shipper
node_health/node_job_healthship individually, validated key by key insanitize.vrl(exact key sets, integer bounds,jobfrom the schema enum).diagnostics.json:db_pool_closed_in_transaction(existing canonical code, TC-2954/TC-3006) and the newdb_pool_acquire_slow.Compose / N0
VECTOR_CONFIG_JSONis regenerated indocker-compose.dstack-postgres.yamlandscripts/ci/fixtures/tc959-n0-compose.yaml. The regeneration procedure reproduces main's line byte-exactly. Rebased on #769 (a0e2ddc, TC-4466 cloudflared restart line kept as merged), the N0 template hash moves0391bb7d…→86ffe6b3be75877b3a35dee1ab42a073860c370c09536148c0dd9b89b7859ba2(raw53a78d72e291efa6f588f0e0ef308211ede3a214360671a07b405a637875e7d7), indocker.yml,docs/releasing.mdand CHANGELOG.Overlap: #606 (TC-3006, open) retargets the same tx-release warning with an
exactmapping. This PR does not touch #606. If #606 lands after this, it must reconcile with it: the warning's target is alreadytinycloud_core::db_pooland it maps todb_pool_closed_in_transactionas ascopedentry here, and the regenerated compose and N0 hash must be redone.Verification
cargo fmt --all -- --check,cargo clippy --all-targets -- -D warningscargo test -p tinycloud-node --lib(1201 pass),cargo test -p tinycloud-core --test sqlx_request_telemetry(18 pass)node --test log-shipper/budget.test.mjs log-shipper/profile.test.mjs log-shipper/ledger.test.mjs log-shipper/ledger-start.test.mjs scripts/tc959-docker.test.mjs scripts/tc959-readiness.test.mjs(55 pass)node scripts/tc959-check.mjspassesvector test,errors_slowandall_requests: 531/531 pass each, including 29 health and pool-code cases.{"level":"INFO","fields":{"message":"node health","interval_ms":31,"cpu_user_ms":0,"cpu_sys_ms":0,"rss_bytes":48029696,"tokio_workers":2,"tokio_tasks":1,"tokio_global_queue":0,"tokio_busy_ms":0,"in_flight":0,"in_flight_max":1,"pool_max":1,"pool_size":1,"pool_idle":1,"pool_in_use":0,"pool_waiting":0,"pool_acquired":0,"pool_timed_out":0,"pool_cancelled":0,"pool_failed":0,"pool_wait_total_ms":0,"pool_wait_max_ms":0},"target":"tinycloud::node_health"} {"level":"INFO","fields":{"message":"node job health","job":"kv_orphans","runs":1,"failures":0,"last_ms":31,"max_ms":31,"running_ms":0},"target":"tinycloud::node_health"}