Skip to content

telemetry.ts: Add span context propagation to telemetry events #634

Description

@Kingsman-99

Description

src/telemetry.ts emits events but does not attach a parent span context when events are nested inside an active trace. This means distributed traces lose their parent-child relationship, making root-cause analysis in tracing backends difficult.

Acceptance Criteria

  • TelemetryEvent type includes an optional parentSpanId field
  • When a span is active, child events automatically inherit the parent span ID
  • Events emitted outside any span have parentSpanId: undefined
  • Unit tests pass

Context

  • Target file: src/telemetry.ts
  • Must not break existing event consumers that do not read parentSpanId

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions