Skip to content

Conversation

@chris-olszewski
Copy link
Member

What was changed

Serialize SpanContext.TraceState before calling the sink and deserialize it before passing it onto the underlying SpanExporter.

Why?

Some SpanExporters such as OTLPTraceExporter will call TraceState.serialize() before exporting spans. This method ended up getting removed as part of the structuredClone that happens when calling the sink and thus the call would fail with TypeError: _a.serialize is not a function.

To prevent this we call serialize() before calling the sink and then createTraceState before passing it onto the SpanExporter.

Checklist

  1. Closes [Bug] opentelemetry traceState is handled properly in makeWorkflowExporter #1738

  2. How was this tested:
    Initial commit added failing test that captured the TypeError: _a.serialize is not a function that happens when using a OTLPTraceExporter when the exporter attempts to serialize the TraceState it received from the workflow.

After fix was applied added more assertions to verify that the TraceState received by the sink is properly deserialized.

  1. Any docs updates needed?
    N/A

@chris-olszewski chris-olszewski marked this pull request as ready for review January 15, 2026 22:17
@chris-olszewski chris-olszewski requested a review from a team as a code owner January 15, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] opentelemetry traceState is handled properly in makeWorkflowExporter

2 participants