[CFX-5205][CFX-5207][CFX-5208] first pass at wiring up Amplitude telemetry#419
Open
[CFX-5205][CFX-5207][CFX-5208] first pass at wiring up Amplitude telemetry#419
Conversation
Add 40 tests covering: - NewClient initialization with different API key and disable flag states - Track method behavior when telemetry is disabled - Flush method behavior - IsEnabled logic - CommonProperties collection and serialization - Environment detection from DataRobot URLs - Session ID generation with UUID v4 format - All 14 event constructors Test coverage for internal/telemetry increased to 64% Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Remove the Current Working Directory (CWD) property from telemetry common properties as it can contain sensitive PII such as usernames and project names (e.g., /home/john.smith/projects/secret-client-app). The CWD property was not being actively used for any analytics purpose and only introduced privacy risk. Users trusting the 'anonymous usage telemetry' label may not opt out, unknowingly leaking identifying information. This aligns telemetry with the promise of anonymity in the --disable-telemetry flag description. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Contributor
Author
|
/run-smoke-tests |
conditionally add AMplitudeAPIKey
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 23624bc. Configure here.
Contributor
Author
|
/run-smoke-tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

RATIONALE
I just wanted to merge in the telemetry feature branch so that it doesn't last any longer than needed.
Until we define the Amplitude API Key in GitHub Actions, all that will happen is we output telemetry events to dr-tui-debug.log. That said, I've defined the events here but haven't actually wired them up anywhere, so really nothing will happen.
CHANGES
disable-telemetryconfig so that we can disable sending to Amplitude entirely; instead, we will log to dr-tui-debug.logTODO
PR Automation
Comment-Commands: Trigger CI by commenting on the PR:
/trigger-smoke-testor/trigger-test-smoke- Run smoke tests/trigger-install-testor/trigger-test-install- Run installation testsLabels: Apply labels to trigger workflows:
run-smoke-testsorgo- Run smoke tests on demand (only works for non-forked PRs)Important
For Forked PRs: If you're an external contributor, the
run-smoke-testslabel won't work. A maintainer must manually trigger the "Fork PR Smoke Tests" workflow from the Actions tab, providing your PR number. Please comment requesting a maintainer review if you need smoke tests to run.Note
Medium Risk
Introduces new telemetry collection and a third-party analytics dependency that can send network traffic in release builds, plus new build-time secrets/ldflags; failures are designed to be non-fatal but could still affect startup/exit hooks.
Overview
Adds an Amplitude-backed
internal/telemetrypackage (client, common-property collection, and typed event constructors) with unit tests, designed to no-op/log when disabled or when no API key is present.Wires telemetry initialization into
cmd/root.goviaPersistentPreRunE(creates client + collects common properties) and flushes on exit viaPersistentPostRunE, and introduces a--disable-telemetryflag/config key.Updates release tooling to actually embed and provide telemetry configuration: GitHub Actions now passes
AMPLITUDE_API_KEY, andgoreleaser.yamlinjectsAmplitudeAPIKeyandInstallMethodvialdflags; also adds theanalytics-godependency (and related sums) plus a placeholderGetUserIDAPI helper.Reviewed by Cursor Bugbot for commit 9a1035b. Bugbot is set up for automated code reviews on this repo. Configure here.