Skip to content

Remove telemetry: usage metrics and OTel command spans - #2

Open
sorcerai wants to merge 1 commit into
mainfrom
remove-telemetry
Open

sorcerai wants to merge 1 commit into
mainfrom
remove-telemetry

Conversation

@sorcerai

@sorcerai sorcerai commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

Removes all telemetry from bd: the anonymous usage-metrics pipeline (internal/metrics + dolthub/eventkit, per-command cli_command events, the $HOME/.beads/eventsData queue, the detached bd send-metrics uploader posting to gastownhall-eventsapi.com) and the OpenTelemetry command-span wiring (command_telemetry.go, initTelemetry/startCommandSpan, the telemetry-only argv scrubbers).

What changed

  • Deleted internal/metrics/ (event queue, flusher, spawn, machine-id, user-config), cmd/bd/metrics.go, cmd/bd/send_metrics.go, cmd/bd/command_telemetry.go, cmd/bd/telemetry_redact.go, and their tests.
  • Unwired cmd/bd/main.go: usage-metrics bootstrap, send-metrics handling, metrics no-DB command entry, first-run notice, CloseAndFlush, OTel init/span/shutdown, commandSpan state, secretFlagTokens/scrubArgsForTelemetry and the DSN-scrub family (telemetry-only).
  • Config: removed metrics.disabled / metrics.endpoint defaults and the MetricsDisabledByUserConfig / UserMetricsEndpoint / MetricsNoticeShownByUserConfig plumbing; metrics. dropped from recognized prefixes. User-global mechanism itself kept (node_id still uses it).
  • Tests: removed BD_DISABLE_METRICS / BD_DISABLE_EVENT_FLUSH / DO_NOT_TRACK harness vars (now dead); rewrote the user-global provenance/authority tests around node_id; kept the no-telemetry-residue guards (eventsData must not appear under isolated HOME).
  • Docs: deleted docs/cli-reference/metrics.md and docs/reference/observability.md; removed bd metrics from CLI_REFERENCE.md, cli-reference index, and docs nav.
  • go.mod: github.com/dolthub/eventkit removed via go mod tidy.

Notes for reviewers

  • internal/telemetry/ (instrumented storage decorators) is intentionally kept: telemetry.Init now has zero callers, so it is permanently no-op, and the decorators are load-bearing types for the storage chain. BD_OTEL_ENABLED no longer activates anything.
  • cmd/bd/doctor/perf_dolt.go's local DoltPerfMetrics variable is unrelated performance reporting, untouched.
  • Net diff: 194 files, −6785/+119 — overwhelmingly deletions of instrumentation blocks.

Validation

  • go build ./... — clean
  • go vet ./... — clean
  • Targeted unit tests pass: internal/config user-global authority tests, cmd/bd config-show provenance test, storage-decorator wiring tests
  • Full integration suite not run (per task scope)

Removes all telemetry from bd:

- internal/metrics (anonymous usage metrics via dolthub/eventkit):
  per-command cli_command events, the event queue under
  $HOME/.beads/eventsData, the detached `bd send-metrics` uploader, and
  the https://gastownhall-eventsapi.com/mp/collect endpoint.
- `bd metrics` / `bd metrics on|off` / `bd metrics example` commands and
  their docs (docs/cli-reference/metrics.md, CLI_REFERENCE.md entries).
- metrics.* config defaults and user-global plumbing
  (MetricsDisabledByUserConfig, UserMetricsEndpoint,
  MetricsNoticeShownByUserConfig); BD_DISABLE_METRICS / BD_DISABLE_EVENT_FLUSH
  / DO_NOT_TRACK test-harness vars removed as dead.
- OTel command-span wiring: cmd/bd/command_telemetry.go (initTelemetry,
  startCommandSpan), the commandSpan lifecycle in main.go, and the
  telemetry-only argv scrubbers (secretFlagTokens, scrubArgsForTelemetry,
  telemetry_redact.go). telemetry.Init now has no callers, so the
  instrumented storage decorators in internal/telemetry are permanently
  no-op; BD_OTEL_* no longer activates anything.
- docs/reference/observability.md (documented the removed OTel export).
- github.com/dolthub/eventkit dropped from go.mod via go mod tidy.

Tests: `go build ./...` and `go vet ./...` clean; targeted unit tests pass
(internal/config user-global authority tests rewritten around node_id;
cmd/bd config-show provenance test rewritten around node_id;
storage-decorator wiring tests pass). Full integration suite not run.

Fixes: bd no longer phones home anywhere. `bd metrics` is gone; there is
nothing to opt out of.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant