feat(dashboard-api): LD-gated ClickHouse read switcher#3111
Conversation
Mirror the api service: replace the single fixed-DSN ClickHouse client with NewSwitchingClient gated on the clickhouse-read-endpoint flag, so dashboard-api reads can shift to the Aiven alternate alongside api. Add ClickhouseConnectionStrings (alternates) and DomainName to config; SetDeploymentName(config.DomainName) so flag evaluation uses the same deployment context as api and both resolve to the same endpoint. WithAllowNoopDefault(true) preserves the prior empty-DSN noop behavior.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
Code Review
This pull request updates the dashboard API configuration to support multiple ClickHouse connection strings and a domain name, and integrates a feature flags client to enable dynamic ClickHouse endpoint switching via a new switching client. There are no review comments, and we have no feedback to provide.
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.
❌ 7 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
What
Migrate
dashboard-apito the LD-gated ClickHouse switching client, mirroring theapiservice (introduced in #3061). Replaces the single fixed-DSN client withclickhouse.NewSwitchingClient, gated on theclickhouse-read-endpointflag, so dashboard-api reads can shift to the Aiven alternate in lock-step withapi.Why
dashboard-apiwas the only ClickHouse reader still hardwired to the single (legacy) DSN with no flag awareness — it would not follow theclickhouse-read-endpointcutover. This brings it in line withapi,data-exporter,argus-api,bot-detection, etc.Changes
internal/cfg/model.go: addClickhouseConnectionStrings(alternates,;-separated) andDomainName.main.go: build a feature-flags client,SetServiceName+SetDeploymentName(config.DomainName)(same deployment context asapi, so both resolve to the same endpoint), and constructNewSwitchingClient(..., WithAllowNoopDefault(true)). The noop-default preserves the prior empty-DSN behavior.Notes
CLICKHOUSE_CONNECTION_STRINGS+DOMAIN_NAMEon the dashboard-api job (separate PR in the terraform repo).go build/go vet/gofmtclean.