GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(node): add ClickHouse instrumentation by adityareddy-dev · Pull Request #26211 · getsentry/sentry-javascript

Conversation

@adityareddy-dev

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

Uh oh!

There was an error while loading. Please reload this page.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@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[bot]
cursor Bot reviewed Nov 9, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/server-utils/src/utils/sql-sanitizer.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/server-utils/src/utils/sql-sanitizer.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

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

adityareddy-dev commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264

JPeer264 commented Nov 13, 2026

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JPeer264
JPeer264 requested changes Nov 17, 2026
View reviewed changes

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread dev-packages/node-integration-tests/package.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/server-utils/src/orchestrion/config/clickhouse.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/server-utils/src/utils/sql-sanitizer.ts Outdated
@@ -0,0 +1,367 @@
let integerLiteralRE: RegExp | undefined;

@JPeer264 JPeer264 Nov 17, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread dev-packages/node-integration-tests/suites/tracing/clickhouse/test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/server-utils/test/integrations/clickhouse.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/server-utils/src/integrations/clickhouse.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sentry-junior sentry-junior Bot mentioned this pull request Nov 17, 2026
docs(javascript): Add ClickHouse integration page getsentry/sentry-docs#20863
Merged
1 of 6 tasks
cursor[bot]
cursor Bot reviewed Nov 18, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread dev-packages/cloudflare-integration-tests/suites/tracing/clickhouse/test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264

JPeer264 commented Nov 19, 2026

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

JPeer264 commented Nov 19, 2026

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adityareddy-dev

adityareddy-dev commented Nov 19, 2026

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264

JPeer264 commented Nov 20, 2026

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264

JPeer264 commented Nov 20, 2026

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264 JPeer264 added the Accept Bundlesize Increase label Nov 20, 2026
JPeer264
JPeer264 approved these changes Nov 20, 2026
View reviewed changes

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
adityareddy-dev and others added 6 commits November 20, 2026 14:00
@adityareddy-dev @JPeer264
feat(node): add ClickHouse instrumentation
c7931ab
@adityareddy-dev @JPeer264
fix(node): Strip ClickHouse FORMAT data after INSERT SELECT
770db77
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.
@adityareddy-dev @JPeer264
fix(node): Strip nested ClickHouse comments
e9b9f37
@adityareddy-dev @JPeer264
test(bun): Run the ClickHouse suite only with bundled scenarios
4f83273
`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`.
@adityareddy-dev @JPeer264
fix(node): Address ClickHouse review feedback
1050574
@JPeer264
fixup! feat(node): add ClickHouse instrumentation
03055eb
@JPeer264
JPeer264 force-pushed the feat/node-clickhouse-instrumentation branch from 47c7b33 to 03055eb Compare November 20, 2026 13:04
cursor[bot]
cursor Bot reviewed Nov 20, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/server-utils/src/integrations/clickhouse-sql.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nicohrubec
Merge branch 'develop' into feat/node-clickhouse-instrumentation
63a553e
cursor[bot]
cursor Bot reviewed Nov 20, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/server-utils/src/integrations/clickhouse-sql.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

adityareddy-dev added 2 commits November 20, 2026 12:26
@adityareddy-dev
fix(node): preserve ClickHouse FORMAT comparisons
c39ceac
@adityareddy-dev
fix(node): Keep ClickHouse format columns after ON, PREWHERE, HAVING,…
8f80dc9
… 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

Uh oh!

There was an error while loading. Please reload this page.

@javascript-sdk-gitflow javascript-sdk-gitflow Bot mentioned this pull request Nov 20, 2026
chore: Add external contributor to CHANGELOG.md #26715
Merged
msonnb pushed a commit that referenced this pull request Nov 23, 2026
@javascript-sdk-gitflow @JPeer264
chore: Add external contributor to CHANGELOG.md (#26715)
8c549b9
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #26211

Co-authored-by: JPeer264 <[email protected]>
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 23, 2026
publish: getsentry/[email protected] getsentry/publish#10541
Closed
51 tasks done
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
Clickhouse instrumentation (@clickhouse/client) #15966
Closed
JPeer264 added a commit to getsentry/sentry-docs that referenced this pull request Nov 24, 2026
@sentry-junior @JPeer264
docs(javascript): Add ClickHouse integration page (#20863)
dd0314f
<!-- Keep the urgency section so automation can prioritize this PR. You
may delete other sections you don't need. -->

## DESCRIBE YOUR PR

This adds a page for `Sentry.clickhouseIntegration`, the new ClickHouse
integration of the JavaScript SDK from getsentry/sentry-javascript#26211
by @adityareddy-dev. Without a page, users can't see which ClickHouse
clients and runtimes are traced, or what query data ends up in their
spans. It covers:

- that the integration is on by default when tracing is enabled
- runtime notes: Node.js runtime only on Next.js, the import hook on
Deno, and `sentryBunPlugin()` on Bun and Elysia
- which client methods are traced (`query`, `command`, `exec`, `insert`)
and that spans need an active parent span
- span names and attributes, and how query text is sanitized (literals,
comments, inline insert data, `{name:Type}` parameters)
- Cloudflare Workers: `@clickhouse/client-web` is traced when the Worker
is built with the Sentry Cloudflare Vite plugin
- supported versions: `@clickhouse/client` and `@clickhouse/client-web`
`>=1.1.0 <2`

It also adds `clickhouseIntegration` to the integration tables of every
server SDK that exports it, next to `typesafeIntegration`, which comes
from the same default list. On Cloudflare it isn't enabled by default,
so the row has no Auto Enabled mark and a note points to the Vite
plugin.

Open decisions:

- getsentry/sentry-javascript#26211 merged after 11.16.0, so
`<AvailableSince version="11.17.0" />` assumes it ships in the next
minor. **Merge after 11.17.0 is released.**

## IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
supplied a deadline.

Thanks in advance for your help!

## PRE-MERGE CHECKLIST

_Make sure you've checked the following before merging your changes:_

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

## EXTRA RESOURCES

- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)

<!-- junior-request-attribution:start -->
via @JPeer264.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0CA6TD3QRK%3A1794939394.715079 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CA6TD3QRK%3A1794939394.715079)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CA6TD3QRK%3A1794939394.715079/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Jan Peer Stöcklmair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@JPeer264 JPeer264 JPeer264 approved these changes
@nicohrubec nicohrubec Awaiting requested review from nicohrubec nicohrubec was automatically assigned from getsentry/team-javascript-sdks-framework
@s1gr1d s1gr1d Awaiting requested review from s1gr1d s1gr1d was automatically assigned from getsentry/team-javascript-sdks-framework
@andreiborza andreiborza Awaiting requested review from andreiborza andreiborza was automatically assigned from getsentry/team-javascript-sdks-server
@Lms24 Lms24 Awaiting requested review from Lms24 Lms24 was automatically assigned from getsentry/team-javascript-sdks-browser
@msonnb msonnb Awaiting requested review from msonnb msonnb was automatically assigned from getsentry/team-javascript-sdks-browser

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Accept Bundlesize Increase external PR from an external contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Clickhouse instrumentation (@clickhouse/client)

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@adityareddy-dev @JPeer264 @nicohrubec
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.