feat(telemetry): track upgrade suggestion shown on 402 errors#5049
Merged
feat(telemetry): track upgrade suggestion shown on 402 errors#5049
Conversation
Coverage Report for CI Build 24125911620Coverage decreased (-0.05%) to 63.79%Details
Uncovered Changes
Coverage Regressions5 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
avallete
approved these changes
Apr 8, 2026
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.
Summary
Adds a
cli_upgrade_suggestedPostHog event that fires whenever the CLI displays a billing upgrade link after receiving a 402 Payment Required response. This lets us measure how often users hit plan-gated features from the CLI and size the upgrade conversion opportunity.Changes
EventUpgradeSuggested(cli_upgrade_suggested) event constant withfeature_keyandorg_slugproperties to telemetry catalogSuggestUpgradeOnErrorto return(string, bool)providing the resolved org slug and whether a 402 was detectedbranches createandbranches updateerror paths, passing bothfeature_keyandorg_slugTesting
Tested locally:
TestSuggestUpgradeOnErrorsubtests pass, including(string, bool)return assertionsinternal/branches/...tests pass (create, update, delete, list, etc.)internal/telemetry/...tests passutilspackage)Linear