Recommended local stack
Configuration
Telemetry is explicit opt-in. SetBD_OTEL_ENABLED=true and configure the
exporter via standard OpenTelemetry SDK environment variables — both go in
your shell profile or workspace .env:
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.
Shell profile (recommended)
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 earlierBD_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
Confirm storage instrumentation locally
To verify the storage decorator chain is wired up without standing up a collector, runbd with stdout exporters and look for bd.storage.*
records on stderr:
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 whenOTEL_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
telemetry.Init() installs no-op providers: hot paths execute only no-op
calls with no memory allocation.