Skip to content

feat(node): add ClickHouse instrumentation - #26211

Merged
JPeer264 merged 9 commits into
getsentry:developfrom
adityareddy-dev:feat/node-clickhouse-instrumentation
Nov 20, 2026
Merged

JPeer264 merged 9 commits into
getsentry:developfrom
adityareddy-dev:feat/node-clickhouse-instrumentation

Conversation

@adityareddy-dev

@adityareddy-dev adityareddy-dev commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Why: Add DB spans for @clickhouse/client and @clickhouse/client-web through Orchestrion, following the maintainer's go-ahead. Rejected calls set span status and still reach the caller without a separate captured error.

How to review: Start with the ClickHouse config and integration, then the Node and Cloudflare scenarios. The sanitizer stays in sql.ts.

Unsure about: Clients with an explicit custom tracer can emit additional spans. The integration leaves that option alone.

Closes #15966

@github-actions github-actions Bot added the external PR from an external contributor label Nov 9, 2026
@adityareddy-dev adityareddy-dev changed the title feat(node): add ClickHouse instrumentation (AR-139) feat(node): add ClickHouse instrumentation Nov 9, 2026
@adityareddy-dev
adityareddy-dev marked this pull request as ready for review November 9, 2026 19:10
@adityareddy-dev
adityareddy-dev requested review from a team as code owners November 9, 2026 19:10
@adityareddy-dev
adityareddy-dev requested review from JPeer264, Lms24, andreiborza, msonnb, nicohrubec and s1gr1d and removed request for a team November 9, 2026 19:10

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@adityareddy-dev
adityareddy-dev requested a review from a team November 13, 2026 11:31
@adityareddy-dev

Copy link
Copy Markdown
Contributor Author

@JPeer264 can you approve the workflows on the latest push?

@JPeer264

Copy link
Copy Markdown
Member

@adityareddy-dev done. Btw I'll review that next week as something else came in this week. Also I'm not too familiar with clickhouse, so I have to go a bit deeper into it to give a proper review.

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for integrating this. It looks pretty good already - I found couple of things that are worth to fix.

@@ -0,0 +1,367 @@
let integerLiteralRE: RegExp | undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there any specific reason to move this into it's own file? I would assume it was because of the max-lines linting rule? If so, you can simply ignore that at the top of the file, so it is easier to see the actual change. We'll take care in the future and split this up in refactoring PRs where it is only moved.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@JPeer264

Copy link
Copy Markdown
Member

@adityareddy-dev since some code changes happened, is this ready to re-review again, or are you still on it? No hurries if there is still some work left

@JPeer264
JPeer264 force-pushed the feat/node-clickhouse-instrumentation branch from 2723867 to 6c3574c Compare November 19, 2026 07:44
@JPeer264

Copy link
Copy Markdown
Member

FYI I rebased your branch to latest develop as one check was failing. I think it’s fixed now with the rebase

@adityareddy-dev

Copy link
Copy Markdown
Contributor Author

Yes, it's ready for another review. The size check still trips the 500-byte limit after the rebase. If the increase looks okay to you, could you add Accept Bundlesize Increase?

@JPeer264

Copy link
Copy Markdown
Member

I am a bit hesitant about this label. It adds around 1kb for the server runtimes because of the sql additions, which are ClickHouse specific. I'll think another day if we should solve this issue or not. Not sure if this is actually fixable for Node, but for Cloudflare this can be fixed for sure. I'll come back to you with an answer on Monday latest.

@JPeer264

Copy link
Copy Markdown
Member

Alright this one day was shorter than expected. I hope it's ok - I pushed to the branch and fixed the bugbot comment and also kinda outsourced the SQL adaptions, so it is a bit more modular now. We still increase the SDK for Node, but Cloudflare stays roughly the same as before.

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks a lot again for your work

adityareddy-dev and others added 6 commits November 20, 2026 14:00
The sanitizer stopped looking for the FORMAT clause once an INSERT reached
SELECT, so rows read through input() stayed in db.query.text. FORMAT is now
the data clause anywhere at the top level of an INSERT, unless the token
before it expects a name, as in SELECT format or FROM format.
`bun run` does not inject the diagnostics channels, so the ClickHouse suite gets no spans there. It passes in the `node-suites-bun-build` project, which bundles the scenarios with `@sentry/bun/plugin`.
@JPeer264
JPeer264 force-pushed the feat/node-clickhouse-instrumentation branch from 47c7b33 to 03055eb Compare November 20, 2026 13:04

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 63a553e. Configure here.

… QUALIFY and NOT

A column named `format` after these keywords was read as the FORMAT clause of an INSERT, so the query text was cut off there. They now count as tokens after which `format` is a name, like WHERE and AND.
@JPeer264
JPeer264 merged commit 5a39728 into getsentry:develop Nov 20, 2026
395 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accept Bundlesize Increase external PR from an external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clickhouse instrumentation (@clickhouse/client)

3 participants