Forward kernel telemetry options - #506
Conversation
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
There was a problem hiding this comment.
Verdict: 1 Medium · 1 Low
Clean, well-tested forwarding of telemetry/runtime identity into the kernel path, and the wrapper-telemetry suppression on useKernel is correct. One medium: getLocaleName uses inverted POSIX locale precedence (checks LANG before LC_ALL/LC_MESSAGES), so overrides are ignored. One low: duplicated env-disable parsing that could drift from DBSQLClient.
| if (scriptPath) { | ||
| return sanitizeProcessName(scriptPath).replace(/\.[^.]*$/, '') || 'node'; | ||
| } | ||
| return 'node'; |
There was a problem hiding this comment.
🟡 Medium — Locale env precedence is inverted. POSIX resolution order is LC_ALL (overrides everything) → the specific category (LC_MESSAGES) → LANG (fallback default). Here the fallback (LANG) is checked first:
const lang = env.LANG || env.LC_ALL || env.LC_MESSAGES || '';Because LANG is set in almost every environment, an LC_ALL/LC_MESSAGES override is silently ignored and the reported localeName will be wrong for any user who overrides the category vars on top of a base LANG. Reorder to env.LC_ALL || env.LC_MESSAGES || env.LANG || '' to match POSIX. This only affects telemetry metadata (not query behavior), hence medium, and the new test (localeName just .to.be.a('string')) does not exercise precedence.
| osVersion: os.release(), | ||
| osArch: os.arch(), | ||
| clientAppName: undefined, | ||
| localeName: getLocaleName(), |
There was a problem hiding this comment.
🔵 Low — isTelemetryDisabledByEnv re-implements the exact DATABRICKS_TELEMETRY_DISABLED parsing that already lives in DBSQLClient.ts (trim + /^(1|true|yes|on)$/i). The two copies can drift — e.g. if one later accepts enabled/0 or a different truthy set, the wrapper opt-out and the kernel opt-out would disagree, which is exactly the invariant this PR is trying to preserve. Consider extracting a single shared helper and having both call sites use it.
Summary
Tests
Notes: