feat: dynamic sandbox log routing and ClickHouse-backed log reads#3236
feat: dynamic sandbox log routing and ClickHouse-backed log reads#3236rguliyev wants to merge 1 commit into
Conversation
❌ 5 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Code Review
This pull request introduces dynamic log write routing and ClickHouse-backed log reading, both controlled by LaunchDarkly feature flags (logs-write-config and logs-read-config). It adds a minimal ClickHouse reader for sandbox and build logs, integrates feature flags into the local cluster resource provider, and updates the hyperloop server and HTTP log writer to support dynamic routing to primary and shadow destinations with bounded concurrency. Feedback on the changes suggests using context.WithoutCancel as the base context in the HTTP log writer to ensure that critical logs emitted during the application shutdown phase are successfully delivered even if the root context is cancelled.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
bd0a2e4 to
e540816
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e540816764
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
51543d6 to
cb652db
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be583e9859
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
be583e9 to
696abc1
Compare
matthewlouisbrockman
left a comment
There was a problem hiding this comment.
preexisting bug it looks like; there's an issue where there's a difference in the clickhouse vs loki ingestion, where loki's rejecting based on age > 7d, clickhouse based on when ingested, and logs before the timestamp on sandbox start is updated can get dropped in loki, and then also logs from when sandbox was pausing/snapshotting and still not flushed can also get into clickhouse and correctly rejected from loki - not sure how to handle that; not ur fault but will cause issues.
What
Makes sandbox log write routing dynamic and adds a ClickHouse-backed read path for local-cluster sandbox/build logs. Both are controlled by LaunchDarkly flags and remain no-ops when the flags are unset.
Write path —
logs-write-configJSON flagHTTPWriterand the hyperloop/logsforwarder resolve their destination per write through a cachedLogWriteConfigResolverinstead of a fixed collector address.LOGS_COLLECTOR_ADDRESSbehavior.Read path —
logs-read-configbool flagclickhouse/pkg/sandboxlogs, a reader for thesandbox_logstable.CLICKHOUSE_CONNECTION_STRINGis configured.Why
Lets the log pipeline migrate collectors and storage backends with flag flips instead of redeploys, while keeping every step reversible and preserving the legacy Loki path as the default.
Testing
go test ./packages/clickhouse/pkg/sandboxlogs ./packages/api/internal/clusters ./packages/api/internal/handlersand targetedgolangci-lint.