Repository navigation
fix(telemetry): pause Mixpanel and give the usage events their final names - #2370
Conversation
…names The production Mixpanel token the CLI and the service ping bake in belongs to a project in Mixpanel's US region, while both send to its EU endpoint, which drops the events. Pause Mixpanel until a project and its region agree: the CLI bakes in no token, so only ZITADEL_TELEMETRY_TOKEN sends to it, and the ping has no default token. The Vercel Web Analytics copy no longer needs a Mixpanel client to send, and the events drop the poc_ prefix: cli_command_started, cli_command_completed, cli_command_failed and service_ping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 19a5092 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🔵 Needs a closer look
It is a cross-cutting telemetry/release change that alters shipped event names and edits customer-facing changesets across the Go server, CLI, and docs, which warrants final human review despite no issues being found.
No open issues 🎉
What changed in this PR
This PR pauses the CLI's and service ping's Mixpanel reporting and promotes the proof-of-concept telemetry events to their final release names. Mixpanel never received production events because the baked-in production token points at a US project while traffic is routed through the EU proxy endpoint; rather than ship a broken integration, this PR removes the baked token so telemetry flows only to Vercel Web Analytics for now, while keeping the Mixpanel plumbing in place for when a correctly-regioned project exists. It fits into the pre-release telemetry work started in #2253 and #2296 (all still unreleased), so it edits those changesets in place rather than contradicting them.
Changes:
- Remove the baked Mixpanel tokens (CLI
config.tsand server ping default), so Mixpanel only sends whenZITADEL_TELEMETRY_TOKEN/service_ping.mixpanel_tokenis set; telemetry is now "enabled" whenever either Mixpanel or the Vercel copy has a destination, and no install id is written when there is no destination. - Drop the
poc_prefix from event names and the catalog'sprefixentries, giving events their release names (cli_command_*,service_ping), with--debugprinting[telemetry] mixpanel: no tokenwhen Mixpanel is inert. - Update docs (telemetry page, product-analytics, cloud runbook, CLI
AGENTS.md) and changesets to describe Vercel-only reporting with Mixpanel paused.
| File | Description |
|---|---|
| apps/cli/src/lib/telemetry/config.ts | Removes baked dev/prod tokens; resolveTelemetryToken now only reads ZITADEL_TELEMETRY_TOKEN; doc comments updated. |
| apps/cli/src/lib/telemetry/consent.ts | Drops the no-token reason and resolved-token field; consent no longer depends on a token. |
| apps/cli/src/lib/telemetry/index.ts | Telemetry is enabled when Mixpanel or Vercel has a destination; builds the Mixpanel client only with a token; skips install-id write when no destination. |
| apps/cli/src/lib/telemetry/vercel.ts | Removes VERCEL_EVENT_PREFIX; Vercel copy keeps the event's own name. |
| apps/cli/src/lib/oclif/command-telemetry.ts, base.ts, user-agent.ts | Comment updates reflecting the paused/no-token wording. |
| apps/cli/AGENTS.md | Documents that Mixpanel is paused and only an explicit token enables it. |
| apps/cli/tests/unit/lib/telemetry/*.test.ts | Updates consent/config/telemetry/vercel/catalog tests for the paused Mixpanel and prefix-free names; adds no-token coverage. |
| internal/serviceping/serviceping.go | Removes EventPrefix/DefaultMixpanelToken; EventName is service_ping; doc comments updated. |
| internal/serviceping/catalog_test.go | Drops prefix assertions; matches events by the un-prefixed EventName. |
| cmd/server/server.go, config.go | Defaults service_ping.mixpanel_token to empty; comment update. |
| docs/product-analytics-events.yaml, product-analytics.md | Remove prefix entries; note Mixpanel is paused while keeping mixpanel as a destination. |
| docs/runbooks/cloud.md, apps/docs/.../telemetry.mdx | Describe Vercel-only reporting today and the paused Mixpanel path. |
| .changeset/cli-vercel-usage-copy.md | Rewritten to describe Vercel-only usage events, nothing to Mixpanel. |
| .changeset/cli-telemetry-proxy.md, server-service-ping-mixpanel.md | Deleted: the CLI/ping no longer send to Mixpanel by default. |
Review effort: Balanced
Summary
Mixpanel has never received the CLI's production events. This PR pauses Mixpanel until that's fixed, and gives the events the names they'll be released under.
Why Mixpanel gets nothing. The production token baked into the CLI (
config.ts), and into the service ping, belongs toNext Gen Production. That project is in Mixpanel's US region. Both send through the cloud's/telemetry/mixpanel/*rewrite toapi-eu.mixpanel.com, the EU endpoint, which drops events for a US project.Next Gen Productionhas received no events in the last 30 days.poc_cli_command_*events.CLI
resolveTelemetryTokenreturns onlyZITADEL_TELEMETRY_TOKEN, so the CLI sends Mixpanel nothing by default. Consent no longer depends on a token.cli_command_startedrather thanpoc_cli_command_started.--debugprints the Mixpanel payload only when Mixpanel sends, and says[telemetry] mixpanel: no tokenwhen it doesn't.Server ping:
service_ping.mixpanel_tokennow defaults to empty, so the ping sends Mixpanel nothing unless a token is set.service_pingrather thanpoc_service_ping.Catalog and docs:
prefixentries and notes the pause. Events keepmixpanelas a destination for when it returns.AGENTS.md,product-analytics.mdand the cloud runbook say Mixpanel is paused.Coming back to Mixpanel: create a production project in the EU region, or point the production channel at the US region, then bake its token back into
config.tsand the ping's default.Validation
moon run cli:typecheck cli:lint cli:test: passed, 4,437 tests in 254 files.go test ./internal/serviceping/: ok.go test ./cmd/server/: every test passes exceptTestBuildHTTPMuxServesTheConsoleAndTheAPIAtRootandTestBuildHTTPMuxDoesNotMountTheAPIUnderAPIPrefix. Both need a console build (moon run console:build), which this worktree didn't have, and neither touches the ping.gofmt -lon the changed Go packages: clean.node scripts/check-changesets-status.mjsand--pending: ok.node scripts/check-pr-title.mjs --title "…": ok.api ls --json --debugwithZITADEL_TELEMETRY_VERCEL_ENDPOINTpointed at a local listener.mixpanel: no token.cli_command_startedandcli_command_completedwith the eight properties, and answered200.Next Gen Production(4035579) holds the CLI's production token. Mixpanel's US server can read it, and it has no events.Next Gen DevandNext Gen QAare EU projects.cloudproject received the CLI'spoc_events.Release notes / changeset
All four telemetry changesets from #2253 and #2296 are still unreleased, so I edited them rather than adding ones that contradict them:
.changeset/cli-vercel-usage-copy.md(@zitadel/cli, minor), rewritten: the CLI sends its anonymous usage events to Vercel Web Analytics, with at most eight properties, and nothing to Mixpanel for now. The released 0.1.0 sends to Mixpanel, so this is what changes for users..changeset/cli-telemetry-proxy.md. The CLI no longer sends to Mixpanel through the cloud by default..changeset/server-service-ping-mixpanel.md. The ping no longer reports to Mixpanel by default..changeset/server-service-ping.md. It already describes a ping to Vercel Web Analytics only.Notes
ZITADEL_TELEMETRY_ENV=development(node apps/cli/bin/run.js …) is production traffic. Onlyscripts/run-cli.mjssets that variable. Without the prefix, such runs land under the release names./_vercel/insights/eventin the format that path expects, as feat(telemetry): send CLI usage events and a service ping to Vercel Web Analytics #2253 noted. That is unchanged here./telemetry/mixpanel/*rewrite, its deployment check and the Mixpanel SDK all stay.🤖 Generated with Claude Code