Skip to content

test(kernel): capture kernel-owned telemetry in the error-category E2E - #603

Merged
vuanhphung merged 2 commits into
mainfrom
vuanhphung/kernel-error-telemetry-capture
Nov 29, 2026
Merged

vuanhphung merged 2 commits into
mainfrom
vuanhphung/kernel-error-telemetry-capture

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

TestKernelE2EErrorTelemetryCategory has failed on every Nightly E2E kernel run since 2026-08-28 (captured error names=[]; latest: run 46236039827). It last passed on 08-27. #451 landed on 08-28 and moved telemetry for kernel-backed connections into the kernel: Connect skips the Go interceptor (shouldSkipDriverTelemetry), and the kernel exports /telemetry-ext from its own Rust HTTP client. The test still read Go's http.RoundTripper, so it could never see an event. It also still expected the Go category execute_statement_failed, which the kernel doesn't emit.

This is a stale test, not a driver regression. The kernel names errors with its ErrorCode slug (telemetry/runtime.rs sanitize_error), and the other kernel-backed drivers report the same names. A live capture against the test warehouse shows the kernel exports CREATE_SESSION, EXECUTE_STATEMENT and DELETE_SESSION stamped databricks-sql-go. The failed statement's event carries error_info {error_name: "SqlError", stack_trace: "42P01"}.

Fix

The test now routes the kernel through a local CONNECT proxy. The proxy re-signs TLS with a test CA, which the kernel trusts through WithKernelTrustedCerts, so verification stays on. It records /telemetry-ext bodies and forwards everything to the real workspace. The test asserts that the failed statement's EXECUTE_STATEMENT event (matched by query id) has error_name == "SqlError" and stack_trace equal to the error's SQLSTATE. Closing the last kernel session on a host flushes the kernel's pending telemetry before Close returns, so the test reads results without sleeping. Test-only change; the workflow already selects this test.

Verification

  • Live against the pecotesting warehouse, linking the v1.5.0 kernel bindings (same tag as KERNEL_REV): 10/10 passes in one process (0.47–0.62s each). The full nightly kernel selection (-run 'TestKernelE2E|…' -skip TestKernelE2EM2M) is green.
  • Negative checks: with enableTelemetry=false, or with it left to this workspace's feature flag, the kernel exports nothing, so the assertion can fail.
  • Nightly E2E on this branch: run 46296232864 passed both blocking jobs. It also ran the non-blocking Reyden step for the first time since August (on main the earlier failure stops the job before that step). There the test failed only because Reyden rejects INSERT INTO with 0A000, so the test now uses a missing-table SELECT. That fails with 42P01 on both legs, the same form TestKernelE2EErrorSurface uses. Re-run: 46297044803.
  • go vet -tags databricks_kernel,e2e . and golangci-lint with the kernel tags report nothing new.

This pull request and its description were written by Isaac.

TestKernelE2EErrorTelemetryCategory has failed every nightly kernel run
since 2026-08-28. Kernel connections stopped using the Go telemetry
interceptor in #451 and the kernel now exports telemetry from its own HTTP
client, so the test's Go RoundTripper captured nothing.

Route the kernel through a local CONNECT proxy that re-signs TLS with a test
CA (trusted via WithKernelTrustedCerts) and records /telemetry-ext bodies.
Assert the failed statement's EXECUTE_STATEMENT event carries the kernel's
code-derived error_name (SqlError), the SQLSTATE in stack_trace, and the
statement id.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@oss-reviewer-bot oss-reviewer-bot 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.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

✅ No issues identified.

The Reyden leg of the kernel nightly rejects INSERT INTO with 0A000 before
resolving the table, so the 42P01 precondition failed there. A missing-table
SELECT fails with 42P01 on both legs (TestKernelE2EErrorSurface already
relies on it); the telemetry assertions are unchanged.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@oss-reviewer-bot oss-reviewer-bot 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.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

✅ No issues identified.

@vuanhphung
vuanhphung enabled auto-merge November 29, 2026 22:07
@vuanhphung
vuanhphung added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 485f701 Nov 29, 2026
16 checks passed
@vuanhphung
vuanhphung deleted the vuanhphung/kernel-error-telemetry-capture branch November 29, 2026 22:21
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.

1 participant