Tier: M (2-4 days) | Type: feature
Context. Production users running the SDK inside a Node service (indexers, notification workers) want spans on scan, decrypt, RPC calls, and key derivation without patching internals. Ship a minimal pluggable tracer interface so an app can adapt any tracer (OpenTelemetry, Sentry, Datadog) without the SDK depending on any of them.
Scope.
Tracer interface: startSpan(name, attrs?): Span; Span has setAttribute, recordException, end.
- Global
setTracer(tracer) in src/index.ts plus per-call tracer override.
- Instrument the hot paths: stellar scan pipeline, RPC client, key derivation, agent tool calls.
- Ship a tiny
@opentelemetry/api example adapter under examples/otel/.
Acceptance.
Files. src/telemetry.ts (new), src/chains/stellar/scan.ts, src/chains/stellar/rpc.ts, src/agent/tools.ts, docs/observability.md (new), examples/otel/ (new).
Tier: M (2-4 days) | Type: feature
Context. Production users running the SDK inside a Node service (indexers, notification workers) want spans on
scan,decrypt, RPC calls, and key derivation without patching internals. Ship a minimal pluggable tracer interface so an app can adapt any tracer (OpenTelemetry, Sentry, Datadog) without the SDK depending on any of them.Scope.
Tracerinterface:startSpan(name, attrs?): Span;SpanhassetAttribute,recordException,end.setTracer(tracer)insrc/index.tsplus per-calltraceroverride.@opentelemetry/apiexample adapter underexamples/otel/.Acceptance.
docs/observability.md(new)@opentelemetry/*Files.
src/telemetry.ts(new),src/chains/stellar/scan.ts,src/chains/stellar/rpc.ts,src/agent/tools.ts,docs/observability.md(new),examples/otel/(new).