Skip to content

controller: write config agent version info to ClickHouse#3578

Open
nikw9944 wants to merge 2 commits intomainfrom
controller-agent-versions-clickhouse
Open

controller: write config agent version info to ClickHouse#3578
nikw9944 wants to merge 2 commits intomainfrom
controller-agent-versions-clickhouse

Conversation

@nikw9944
Copy link
Copy Markdown
Contributor

@nikw9944 nikw9944 commented Apr 24, 2026

Summary of Changes

  • Add a controller_agent_versions ClickHouse table using ReplacingMergeTree(updated_at) keyed by device_pubkey to track the latest agent and controller version per device
  • The controller writes on every GetConfig poll; ClickHouse merges rows down to one per device. Lake queries with FINAL for deduplicated results
  • Keep controller_grpc_getconfig_success lean (timestamp + device_pubkey only) — separates event tracking from version state
  • Companion: web/api: show agent versions on device detail page lake#534 adds controller_agent_versions to Lake's external remote table proxies
  • Allows malbeclabs/lake to display device config agent version info
  • Schema is still simple so not adding goose migrations at this point

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 2 +98 / -12 +86
Scaffolding 1 +1 / -1 +0
Docs 1 +21 / -2 +19
Total 4 +120 / -15 +105

Small feature — mostly core logic (ClickHouse writer + flush), with minimal scaffolding.

Testing Verification

  • go build ./controlplane/controller/... — builds clean
  • go test ./controlplane/controller/... — all existing tests pass
  • go vet ./controlplane/controller/... — no issues

Write agent and controller version info to a separate
ReplacingMergeTree table keyed by device_pubkey. ClickHouse
merges rows down to one per device; Lake queries with FINAL.

The existing controller_grpc_getconfig_success table stays
lean (timestamp + device_pubkey only) for event tracking.
@nikw9944 nikw9944 force-pushed the controller-agent-versions-clickhouse branch from b027dcf to ca4f2fc Compare April 24, 2026 00:42
@nikw9944 nikw9944 requested review from packethog and snormore April 24, 2026 00:46
@nikw9944 nikw9944 changed the title controller: add controller_agent_versions ClickHouse table controller: write config agent version info to ClickHouse Apr 24, 2026
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.

1 participant