Repository navigation
feat(ENG-15367): capture usage facts and send one event at the end of every run - #571
Open
tigh-latte wants to merge 1 commit into
Open
tigh-latte wants to merge 1 commit into
tigh-latte wants to merge 1 commit into
Conversation
This was referenced Oct 29, 2026
tigh-latte
force-pushed
the
eng-14331-4-capture
branch
from
November 2, 2026 10:26
62df0c2 to
644a4a8
Compare
tigh-latte
force-pushed
the
eng-14331-3-sender
branch
2 times, most recently
from
November 3, 2026 13:58
221d096 to
a62e7b9
Compare
tigh-latte
force-pushed
the
eng-14331-4-capture
branch
from
November 3, 2026 13:58
644a4a8 to
9eef816
Compare
tigh-latte
marked this pull request as ready for review
November 4, 2026 10:15
tigh-latte
force-pushed
the
eng-14331-4-capture
branch
from
November 4, 2026 11:13
9eef816 to
b8198d6
Compare
… every run A hook on the root command records the command path, the flags and aliases used, where each setting came from, the login method and the API status, all from the Click context, so new commands and flags need no telemetry code. AliasGroup.main hands the run to the sender when it ends. Credential helper commands and login use the tracked command classes so their runs are recorded (or excluded) consistently. Grouped short options (-vS, -vPname) are split up as Click does, so a typed -S or -P always reaches the send rules. The reported env var is the first non-empty one, as Click uses, and a typed --help only counts as help when the run succeeded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tigh-latte
force-pushed
the
eng-14331-4-capture
branch
from
November 5, 2026 10:28
b8198d6 to
78f2b84
Compare
tigh-latte
force-pushed
the
eng-14331-3-sender
branch
from
November 5, 2026 10:28
1e17d72 to
307995e
Compare
This branch has not been deployed
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.
Description
This PR wires usage telemetry into the CLI. A hook on the root command records facts from the Click context, and
AliasGroup.mainhands them to the sender from #570 when the run ends. New commands and flags show up in telemetry with no telemetry code.usage_capture.pyrecords the command path, parameter names and where each value came from, the typed flag spellings and aliases, the login method and the API status. It records names defined in code only, never values. Grouped short options (-vS,-vPname) are split up as Click does, so a typed-Sor-Palways reaches the send checks.config_sources.pyreports which config or credentials file and profile set a setting, by setting name only.handle_api_exceptionsrecords the HTTP status of a handled API error.loginnow use the tracked command classes, so their runs are recorded or excluded the same way as every other command.Behaviour changes
test_startup_imports.pynow also fails ifcloudsmith_cli.core.usageloads at startup. The usage code only loads at the end of a run.How to try it
Output on stderr
outcomeis one ofsuccess,help,usage_error,click_error,api_error,error_exit,abortedorunexpected_error.exit_codeis the raw value the process exits with today.Type of Change
Additional Notes
N/A: there are no user-facing changes while no project key is set.
🤖 Generated with Claude Code