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 — fix(telemetry): sanitize error telemetry and report result delivery shape by vuanhphung · Pull Request #596 · databricks/databricks-sql-nodejs

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Error telemetry copied the raw server error message and the JS stack into the emitted telemetry.error event and into the exported error_info.stack_trace. Server messages quote the failing SQL's identifiers (for example The table or view `sensitive_table` cannot be found), so table and column names left the customer process. Separately, statement.complete never reported resultFormat or compressed. The format was read from facade metadata that is only set when the application calls getMetadata(), and compressed was not passed at all.

Error telemetry now carries only the error class name and the server SQLSTATE. This matches the kernel's sanitized error_info (error_name + SQLSTATE in stack_trace, from databricks-sql-kernel#272). The emitter, aggregator and exporter each drop message and stack, so in-process listeners and the export see the same descriptor. On Thrift, statement.complete now takes resultFormat and compressed from result metadata the backend already holds (direct results, or the fetch the result handler already made) through a new optional IOperationBackend.getCachedResultMetadata(). This adds no RPC. compressed mirrors the server-declared lz4Compressed.

Verification: new unit tests cover the emitted and exported payloads. On origin/main, 15 new or updated tests fail; on this branch the full unit suite passes (1545), and lint, type-check and build are clean. Live Thrift run against a warehouse, with the exporter stubbed to a local capture so nothing was sent:

  • SELECT 1: INLINE_ARROW / false.
  • catalog_returns: EXTERNAL_LINKS / false, matching wire lz4Compressed=false.
  • Inline result with useCloudFetch: false: INLINE_ARROW / true, matching wire lz4Compressed=true.
  • Failing SELECT secret_token FROM sensitive_table, sync and async: OperationStateError + 42P01, and the canaries appear in neither the emitted events nor the export.

origin/main on the same run left the delivery fields unset and exported Error: [TABLE_OR_VIEW_NOT_FOUND] The table or view `sensitive_table`…. The Thrift e2e specs (operation_error_codes, arrow, cloudfetch, batched_fetch, data_types, iterators, query_parameters, timeouts) pass with telemetry captured locally, and every captured stack_trace is a SQLSTATE or empty.

Performance: the change only runs once per statement at close, and once per error, when telemetry is on. In a micro-benchmark (5 alternating fresh-process runs, median), close() went from 4.54 to 4.48 µs/op, which is noise, and error emission went from 10.58 to 0.85 µs/op because the regex redaction of message and stack is gone.

Not addressed here: the [sea] legs of TELEMETRY-001/002/005. Since #506 the driver does not initialize JS telemetry when useKernel is set. The Rust kernel owns statement telemetry there, and the pinned KERNEL_REV already includes databricks-sql-kernel#272, the reference fix. A live kernel run confirmed the JS layer emits nothing.

Addresses #508

This pull request and its description were written by Isaac.

Sorry, something went wrong.

Uh oh!

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

All reactions
@vuanhphung Isaac
fix(telemetry): sanitize error telemetry and report result delivery s…
18cff9e
…hape

Error telemetry copied the raw server error message and JS stack into the
emitted event and the exported payload, leaking SQL-derived identifiers.
It now carries only the error class name and the server SQLSTATE, matching
the kernel's sanitized error_info; the emitter, aggregator and exporter each
drop message/stack.

statement.complete on the Thrift backend now reports resultFormat and
compressed from result metadata the backend already holds (direct results
or the result path's fetch), with no extra RPC.

Signed-off-by: Vu Anh Phung <[email protected]>
Co-authored-by: Isaac <[email protected]>
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 23:30 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 23:30 — with GitHub Actions Inactive
@vuanhphung
vuanhphung temporarily deployed to azure-prod November 11, 2026 23:30 — with GitHub Actions Inactive
peco-review-bot[bot]
peco-review-bot Bot approved these changes Nov 11, 2026
View reviewed changes

@peco-review-bot peco-review-bot 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.

✅ No issues identified by the review bot.

Sorry, something went wrong.

Uh oh!

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

All reactions

This branch was previously deployed

1 inactive deployment
azure-prod — 18cff9e4 Deployed Nov 11, 2026 by vuanhphung via e2e-test (24.22.1, 24_22_1) #1887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@peco-review-bot peco-review-bot[bot] peco-review-bot[bot] approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

@vuanhphung
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 01402503 — 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.