Skip to content

OpenTelemetry-compatible instrumentation hooks #177

Description

@truthixify

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.

  • Zero-tracer default is a no-op with negligible overhead (bench)
  • Example adapter emits spans covering an end-to-end scan
  • Spans carry stable attribute names documented in docs/observability.md (new)
  • No new runtime dep on @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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programdripsFunded via Drips NetworkdxDeveloper experiencehelp wantedExtra attention is neededobservabilityAuto-created for Wave 8stellar-waveAuto-created for Wave 8wave-8Auto-created for Wave 8

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions