Skip to main content
Beads exports metrics via OTLP HTTP. Telemetry is disabled by default — zero overhead when no variable is set.

Configuration

Telemetry is explicit opt-in. Set BD_OTEL_ENABLED=true and configure the exporter via standard OpenTelemetry SDK environment variables — both go in your shell profile or workspace .env:
A standard OTEL_* variable alone will not turn bd telemetry on — bd won’t auto-activate from a machine-global OTEL_* setting that was set for some other instrumented tool. Log export is not implemented yet. BD_OTEL_LOGS_URL is reserved for a future VictoriaLogs exporter and does not activate telemetry today.

Environment variables

Resource attributes

Every metric and span carries the OTel resource describing the bd process: Add anything else via OTEL_RESOURCE_ATTRIBUTES.

Local debug mode

Legacy environment variables (deprecated)

The earlier BD_OTEL_* data variables are honored for backwards compatibility. Setting any of them activates telemetry on its own (no BD_OTEL_ENABLED=true required) and translates to the standard OTLP equivalent — a legacy value wins over a pre-existing OTEL_* value so a machine-global OTEL_* setting cannot silently redirect bd telemetry. Each bd invocation that sees one logs a one-line deprecation warning to stderr:

Verification

Verification queries in Grafana (VictoriaMetrics datasource):

Confirm storage instrumentation locally

To verify the storage decorator chain is wired up without standing up a collector, run bd with stdout exporters and look for bd.storage.* records on stderr:
Expect at least one line per storage call (GetReadyWork, GetIssue, …). If bd.storage.* and bd.issue.count are absent but bd.db.pool_* is present, the storage decorator is not in the chain — check wireStorageDecorators in cmd/bd/storage_chain.go.

Metrics

Storage (bd_storage_*)

These metrics are emitted by InstrumentedStorage, the beads SDK wrapper.

Dolt database (bd_db_*)

Issues (bd_issue_*)

status values: open, in_progress, closed, deferred.

AI (bd_ai_*)


Traces (spans)

Spans are only exported when OTEL_TRACES_EXPORTER=console — there is no trace backend in the recommended local stack.

Notable attributes

bd.command.<name> hook.exec The hook.stdout / hook.stderr events carry two attributes: output (the text) and bytes (original size before truncation).

Architecture

When no OpenTelemetry SDK environment variable selects an exporter, telemetry.Init() installs no-op providers: hot paths execute only no-op calls with no memory allocation.