Repository navigation
Add opt-out PostHog telemetry to the Python CLI - #135
Open
manish-wekan wants to merge 7 commits into
Open
manish-wekan wants to merge 7 commits into
manish-wekan wants to merge 7 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ide. Telemetry now uses a built-in public project key when NITROSTACK_POSTHOG_KEY is unset; NITROSTACK_POSTHOG_HOST still defaults to US Cloud. Renamed the override env to NITROSTACK_POSTHOG_KEY, documented behavior, added roadmap item, and a test that the default key is resolved without network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vendored projects do not need the PostHog SDK; the CLI no-ops when import posthog fails. Fix E501 on the default-key comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assert capture is blocked under opt-out and allowed otherwise so tests do not pass vacuously under PYTEST_CURRENT_TEST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
manish-wekan
marked this pull request as ready for review
November 11, 2026 12:44
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.
What
On-by-default, opt-out PostHog telemetry for the
nitrostackPython CLI, following the shared Nitrostack event taxonomy (<product>_<object>_<action>).nitrostack/cli/telemetry.py: a small client with the super propertiesproduct,surface,environmentandapp_version; identifies by the NitroCloud user id with anemailperson property and groups by organization.main.pyandpack.py: command runs,init, pack/deploy, and login identity.phc_key, safe to embed) as the default;NITROSTACK_POSTHOG_KEYandNITROSTACK_POSTHOG_HOSToverride it.DO_NOT_TRACK=1orNITROSTACK_TELEMETRY=0. Also off in CI (CI,GITHUB_ACTIONS) and under pytest unlessNITROSTACK_TELEMETRYis set. Telemetry never blocks or fails a command.docs/analytics-events.md(event dictionary), README and.env.example.Tests
tests/test_telemetry.pyruns against a local stub capture server, never real PostHog. It covers the opt-out, the payload shape, identify/group, and failure isolation.Review notes
posthogdependency (pyproject.toml,uv.lock).🤖 Generated with Claude Code