Skip to content

Telemetry

The CLI reports on its own operation through three independent sinks. Each one answers a different question, each activates from an environment variable with a built-in fallback, and one switch — HOLOCRON_TELEMETRY=false — turns off all three.

Sink Concern Activation
Sentry (errors) error tracking + performance spans HOLOCRON_SENTRY_DSN → SENTRY_DSN → built-in DSN
Axiom (logs) structured operational logs HOLOCRON_AXIOM_TOKEN + HOLOCRON_AXIOM_DATASET (see Logging)
PostHog (usage) product analytics — adoption, frequency, failure rates HOLOCRON_POSTHOG_PROJECT_TOKEN → POSTHOG_PROJECT_TOKEN → built-in key
Terminal window
export HOLOCRON_TELEMETRY=false

Disables Sentry, the Axiom transport, and PostHog for the run. NO_HOLOCRON_TELEMETRY (any value) is kept as a back-compat alias. Nothing is initialised and no network connection is attempted.

In a workflow, set it once at the job or step level — the secret can stay in place.

Opting out in the repo, not the environment

Section titled “Opting out in the repo, not the environment”

Sentry and PostHog both ship a built-in fallback DSN / key, so removing env vars does not turn them off — there is nothing to remove. For a committed, reviewable choice, add a telemetry block to holocron.config:

import { defineConfig } from "@theholocron/cli";
export default defineConfig({
// …
telemetry: {
enabled: false, // no-ops Sentry + PostHog for every command in this repo
},
});

Or keep error reporting and drop only usage analytics:

telemetry: {
analytics: "none", // PostHog off, Sentry unaffected
}

Precedence — each layer overrides the one below:

Layer Effect
HOLOCRON_TELEMETRY=false / NO_HOLOCRON_TELEMETRY env all three sinks off, before anything initialises
telemetry.enabled: false in holocron.config Sentry + PostHog off (applied after config loads)
telemetry.analytics: "none" in holocron.config PostHog off only
built-in default on

The config block is an override layer, not the primary switch. It is applied after the CLI has loaded config, so it never re-enables what the env var turned off — and one event (command_started) is emitted before config loads, so a telemetry.enabled: false repo still sends that single event with no follow-up. If you need a guaranteed zero-leak opt-out, use HOLOCRON_TELEMETRY=false — it gates before the CLI emits anything.

Answers “which commands are actually used, how often, by how many machines, which fail most” — the questions Sentry spans are the wrong tool for. Decided in ADR-0008.

HOLOCRON_POSTHOG_PROJECT_TOKEN → POSTHOG_PROJECT_TOKEN → built-in fallback key
HOLOCRON_POSTHOG_HOST → POSTHOG_HOST → https://us.i.posthog.com

The built-in fallback is Holocron’s own ingest-only project write key (phc_…) — it can capture events, never read data — so it ships in the published package and usage telemetry is on by default, the same risk model as the hard-coded Sentry DSN. Nothing needs configuring.

A consumer repo can route its CLI usage to its own project by setting POSTHOG_PROJECT_TOKEN (a plain variable, not a secret — the key is publishable). In CI, the sync and sync-github reusable workflows forward that variable when it’s set; unset, they fall through to the built-in key.

Events are attributed to sha256(hostname + username), truncated — a one-way per-machine fingerprint. No raw hostname, username, repo path, token, or file content is ever transmitted. Person properties are limited to { ci, os, node, org }.

Event When Properties
command_started command begins command, ci, dry_run, runId
command_completed command returns ok command, duration_ms, status: "ok", runId
command_failed command returns non-ok command, duration_ms, error_type, runId
sync_github_run each sync github invocation repo, branch, status, repos_targeted, files_changed, pr_opened, runId

error_type is the error constructor name only (AuthError, ProviderApiError, …) — never the message. Every event carries the logger’s runId, so a PostHog event pivots straight to the full Axiom trace for that run. Every properties object is run through the same token scrubber Sentry uses before it leaves the process.

See the Sentry plugin page. HOLOCRON_SENTRY_DSN → SENTRY_DSN → built-in DSN; error payloads are scrubbed of token-shaped strings via beforeSend.

See Logging for the full token / dataset resolution and what each command emits.