Skip to content

fix(warehouse): instrument the clickhouse v2 load path - #7355

Merged
achettyiitr merged 1 commit into
release/1.86.xfrom
fix.ch-v2-load-metrics
Sep 9, 2026
Merged

achettyiitr merged 1 commit into
release/1.86.xfrom
fix.ch-v2-load-metrics

Conversation

@achettyiitr

@achettyiitr achettyiitr commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Description

Stacked on #7354 — review that one first; this PR's diff is only the instrumentation.

The v2 loader carried a stats handle and never used it, so the whole path was unobserved where v1 emitted seven measurements. A destination moving to v2 lost every load metric it had. This restores them rather than adding anything new.

Metrics

metric v1 counterpart
warehouse.clickhouse.numRowsLoadFile same name
warehouse.clickhouse.downloadLoadFilesTime same name
warehouse.clickhouse.loadTableTime same name
warehouse.clickhouse.commitTime same name, same meaning
warehouse.clickhouse.blockReadTime none
warehouse.clickhouse.blockPrepareTime none
warehouse.clickhouse.blockBindTime none
warehouse.clickhouse.blockSize none
warehouse.clickhouse.blocks none
warehouse.clickhouse.blockRetries none

The whole set reuses v1's tag set, so a destination stays comparable across the migration on one dashboard. The block-level metrics have no v1 counterpart because v1 commits a table once and v2 commits every commitEvery rows.

Why a block is timed in four parts

Each part is bounded by something different:

  • blockReadTime — CSV parse, client CPU
  • blockPrepareTime — a round trip
  • blockBindTime — bindValue per cell plus the driver's append, client CPU only, because ExecContext appends to a client-side batch and sends nothing
  • commitTime — the single wire write, since the driver's Commit is batch.Send

Timed together they cannot tell a saturated server from a saturated loader. That ratio is the thing worth knowing before spending concurrency or moving commitEvery, both of which are open questions on this path.

Linear Ticket

https://linear.app/rudderstack/issue/INT-7100/crew-workspace-loading-is-taking-lot-of-time

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.23404% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.34%. Comparing base (c835fc0) to head (1b1733b).

Files with missing lines Patch % Lines
warehouse/integrations/clickhouse/load_v2.go 78.57% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.86.x    #7355      +/-   ##
==================================================
+ Coverage           80.30%   80.34%   +0.04%     
==================================================
  Files                 615      616       +1     
  Lines               69184    69224      +40     
==================================================
+ Hits                55556    55620      +64     
+ Misses              10365    10338      -27     
- Partials             3263     3266       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from fix.ch-v2-block-retry to release/1.86.x September 9, 2026 10:07
@achettyiitr
achettyiitr force-pushed the fix.ch-v2-load-metrics branch from 3663482 to f6cfb41 Compare September 9, 2026 10:15
The v2 loader carried a stats handle and never used it, so the whole path
was unobserved where v1 emitted seven measurements. A destination moving
to v2 lost every load metric it had — this restores them rather than
adding anything new.

Adds rows per load, download time and total load time, plus size, count
and retries per block. The first three reuse v1's names and the whole set
reuses v1's tag set, so a destination stays comparable across the
migration; the block-level ones have no v1 counterpart because v1 commits
a table once and v2 commits every commitEvery rows.

A block is timed in four parts rather than one — read, prepare, bind and
commit — because each is bounded by something different: reading and
binding are client CPU, preparing is a round trip, and the commit is the
single wire write, since ExecContext only appends to a client-side batch.
Timed together they cannot tell a saturated server from a saturated
loader, and that ratio is the thing worth knowing before spending
concurrency or moving commitEvery. commitTime keeps v1's name and now
covers the same thing v1's does.

The new histograms get buckets. Timers and histograms are both OTel
histograms, so anything without an entry in runner/buckets.go falls back
to defaultWarehouseHistogramBuckets, which spans 0.1s to 3h. blockSize is
a row count bounded by commitEvery, so every observation would have landed
in the overflow bucket, and the per-block timers resolve below the 0.1s
that default starts at. commitTime, loadTableTime and downloadLoadFilesTime
keep the default, since v1 emits them under the same names and the point
is to stay comparable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014pXCMMrSLnt63xCWqvXhQ4
@achettyiitr
achettyiitr force-pushed the fix.ch-v2-load-metrics branch from f6cfb41 to 1b1733b Compare September 9, 2026 11:05
@achettyiitr
achettyiitr merged commit 6456c64 into release/1.86.x Sep 9, 2026
113 of 115 checks passed
@achettyiitr
achettyiitr deleted the fix.ch-v2-load-metrics branch September 9, 2026 11:50
achettyiitr pushed a commit that referenced this pull request Sep 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.86.1](v1.86.0...v1.86.1)
(2026-09-09)


### Bug Fixes

* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([6456c64](6456c64))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([c835fc0](c835fc0))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([3a1407c](3a1407c))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([72390f6](72390f6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
atzoum pushed a commit that referenced this pull request Sep 9, 2026
# Description

Syncing patch release v1.86.1 to main branch

**↓↓ Please review and edit commit overrides before merging ↓↓**

BEGIN_COMMIT_OVERRIDE
fix(warehouse): retire idle clickhouse v2 connections (#7352)
fix(warehouse): retry a failed clickhouse v2 block (#7354)
fix(warehouse): pass temporary credentials to the clickhouse v2 s3 copy
engine (#7353)
fix(warehouse): instrument the clickhouse v2 load path (#7355)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Akash Chetty <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
atzoum pushed a commit that referenced this pull request Sep 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.1](v1.86.0...v1.87.0-rc.1)
(2026-09-14)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
This was referenced Sep 14, 2026
atzoum pushed a commit that referenced this pull request Sep 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.2](v1.86.0...v1.87.0-rc.2)
(2026-09-14)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
This was referenced Sep 14, 2026
atzoum pushed a commit that referenced this pull request Sep 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.3](v1.86.0...v1.87.0-rc.3)
(2026-09-14)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **router:** request fails with unexpected use of stub RoundTripper
error ([#7386](#7386))
([2ff491f](2ff491f))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
This was referenced Sep 15, 2026
atzoum pushed a commit that referenced this pull request Sep 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.4](v1.86.0...v1.87.0-rc.4)
(2026-09-15)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **batchrouter:** retry failed async manager initialization
([#7374](#7374))
([974d383](974d383))
* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **router:** request fails with unexpected use of stub RoundTripper
error ([#7386](#7386))
([2ff491f](2ff491f))
* singer-protocol sources filtered destination config for source type
cloud instead of cloudSource
([#7389](#7389))
([f48c997](f48c997))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
atzoum pushed a commit that referenced this pull request Sep 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0](v1.86.0...v1.87.0)
(2026-09-15)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **batchrouter:** retry failed async manager initialization
([#7374](#7374))
([974d383](974d383))
* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **router:** request fails with unexpected use of stub RoundTripper
error ([#7386](#7386))
([2ff491f](2ff491f))
* singer-protocol sources filtered destination config for source type
cloud instead of cloudSource
([#7389](#7389))
([f48c997](f48c997))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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.

3 participants