Repository navigation
feat(telemetry): add AppBuilder::without_end_user_telemetry - #187
Merged
Merged
Conversation
An end-user install of an app that opts out ships no telemetry: no `telemetry` command group, no telemetry doctor checks, no first-run notice and no export. Startup never runs, so stored consent is not read either. A Service process is unaffected. For a binary that is a service where an operator runs it and a program a person runs themselves, picking its Deployment per process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An opted-out end user reads none of the framework's telemetry variables, so root help no longer documents them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
AppBuilder::without_end_user_telemetry()(featuretelemetry). On anend-user install it ships no telemetry:
telemetrycommand group;telemetry.*ones);<APP>_TELEMETRY_*,OTEL_*,DO_NOT_TRACK) inroot help, since nothing reads them;
stored consent from an earlier version is not read; the policy stays at the
build-time resolution, which is
Offfor an end user.A
Deployment::Serviceprocess is unaffected: its telemetry stays theoperator's decision, through
OTEL_*and the kill switches.Why
Some binaries are both a service and a program a person runs. Pauta is the
first one:
pauta serveruns as an Instance in the cluster, where tracesshould go to the collector; on a laptop the same binary is the CLI, with
pauta self(which ADR 0080 keeps end-user only). The app picks itsDeploymentper process. Without this opt-out, the laptop process tells theperson "usage statistics are off. Turn them on with
pauta telemetry set usage", and adds atelemetrygroup and six doctor checks, for an app whoseauthor never meant to collect anything from it. With
Serviceon everyprocess,
selfis gone.What could leak or be bypassed
The change only removes paths: when the flag is set and the process is an
end user, startup returns a no-op guard before opening the store or building
an exporter. Nothing new is sent.
stored_consent_does_not_turn_an_opted_out_end_user_back_on: a settingsfile that says
usageturns the control app on, and leaves the opted-outapp at
Off.a_service_keeps_its_telemetry_under_the_opt_out: a Service still has allsix telemetry checks.
Tests
tests/unit/end_user_telemetry_opt_out.rs, six tests. Each one has a control(the same app without the opt-out). With the method made a no-op, the five
end-user tests fail; the Service test passes either way by design. The help
test also fails with only the help gate removed.
cargo fmt --check: clean.cargo clippy --all-features -- -D warnings: clean.cargo check --no-default-featuresand default features: clean.cargo test --all-features(before the help gate commit): 1796 passed,0 failed, 138 test binaries. After it, the opt-out file: 6 passed.
Docs:
docs/telemetry.md"Declaring the deployment" and the CHANGELOG(Unreleased → Added).
🤖 Generated with Claude Code