Skip to content

fix(telemetry): send structured cli usage instead of the raw command line (backport v0.35 oss) - #4284

Merged
cbalan merged 1 commit into
v0.35from
backport/v0.35/f7f4ca49081d2c58665d4b737a5bd11b545037a7
Nov 19, 2026
Merged

cbalan merged 1 commit into
v0.35from
backport/v0.35/f7f4ca49081d2c58665d4b737a5bd11b545037a7

Conversation

@loft-bot

@loft-bot loft-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Backport of commit f7f4ca49081d2c58665d4b737a5bd11b545037a7 to v0.35 (oss half).

Backported Commits:

  • f7f4ca490 fix(telemetry): send structured cli usage instead of the raw command line

Note

Medium Risk
Changes what telemetry sends and could hide useful diagnostics if categorization is wrong, but the intent is to reduce leakage of secrets from the command line.

Overview
CLI telemetry no longer records os.Args or raw error strings. telemetry.StartCLI now takes the active cobra.Command and snapshots structured invocation metadata at pre-run (before flags mutate bound variables).

Emitted event properties include the command path, set flag names, flag_values only for booleans and an allowlisted set (driver, output, chart-version, etc.), positional arg count, resolved driver, duration_ms, and on failure a fixed error category (e.g. kubernetes_unauthorized, timeout) instead of message text.

New helpers in pkg/telemetry/cli_event.go implement property building and error categorization; cli_event_test.go asserts that arbitrary user input (secrets, URLs, passthrough args) never appears in the analytics payload.

Reviewed by Cursor Bugbot for commit 2ffb63b. Bugbot is set up for automated code reviews on this repo. Configure here.

Fixes ENGCP-2038

…line (backport v0.35 oss)

Backport of source commit f7f4ca49081d2c58665d4b737a5bd11b545037a7 (oss half) onto v0.35.
@loft-bot
loft-bot requested a review from a team as a code owner November 18, 2026 13:00
@github-actions

Copy link
Copy Markdown
Contributor

E2E Ginkgo Tests

Status Commit Run
Passed 2ffb63b5fcd19ad4b537eb20f67da808358e8492 View run #44309305462

@cbalan
cbalan merged commit 3ad6303 into v0.35 Nov 19, 2026
28 of 35 checks passed
@cbalan
cbalan deleted the backport/v0.35/f7f4ca49081d2c58665d4b737a5bd11b545037a7 branch November 19, 2026 15:23
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.

2 participants