Skip to content

Add parentTraceContext to entity operation proto messages#64

Open
cgillum wants to merge 2 commits intomainfrom
fix/entity-trace-context
Open

Add parentTraceContext to entity operation proto messages#64
cgillum wants to merge 2 commits intomainfrom
fix/entity-trace-context

Conversation

@cgillum
Copy link
Member

@cgillum cgillum commented Mar 1, 2026

Summary

Entity operations triggered from orchestrations don't currently propagate distributed trace context because the relevant proto messages lack parentTraceContext fields.

Changes

  • Add TraceContext parentTraceContext = 5 to SendEntityMessageAction — allows the SDK to attach trace context when sending entity operations from orchestrations
  • Add TraceContext parentTraceContext = 6 to EntityOperationSignaledEvent — allows backends to propagate trace context through signaled entity operations
  • Add TraceContext parentTraceContext = 8 to EntityOperationCalledEvent — allows backends to propagate trace context through called entity operations

These additions bring entity operations to parity with ScheduleTaskAction/TaskScheduledEvent and CreateSubOrchestrationAction/SubOrchestrationInstanceCreatedEvent, which already have parentTraceContext fields.

Related

Fixes microsoft/durabletask-dotnet#653

Entity operations triggered from orchestrations don't currently propagate
distributed trace context because SendEntityMessageAction lacks a
parentTraceContext field. This is unlike ScheduleTaskAction and
CreateSubOrchestrationAction, which already have this field.

Add parentTraceContext to SendEntityMessageAction so that entity
operations can be linked to the trace of the calling orchestration.

Fixes microsoft/durabletask-dotnet#653
cgillum added a commit to microsoft/durabletask-dotnet that referenced this pull request Mar 1, 2026
Entity operations triggered from orchestrations don't propagate
distributed trace context because SendEntityMessageAction lacks a
parentTraceContext field. This causes entity operations to appear
disconnected from their parent orchestration traces.

Changes:
- Vendor updated proto with parentTraceContext field on SendEntityMessageAction
  (see microsoft/durabletask-protobuf#64)
- Set ParentTraceContext in ProtoUtils.ConstructOrchestratorResponse for
  entity message actions (matching existing behavior for tasks and
  sub-orchestrations)
- Add unit tests for entity trace context propagation

Note: A corresponding server-side change is also needed in the Durable Task
Scheduler backend to propagate SendEntityMessageAction.ParentTraceContext
to OperationRequest.traceContext on entity work items.

Fixes #653
These fields allow the DTS backend to propagate trace context from
SendEntityMessageAction through to entity operation events, completing
the trace context chain for entity operations.
@cgillum cgillum changed the title Add parentTraceContext to SendEntityMessageAction Add parentTraceContext to entity operation proto messages Mar 2, 2026
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.

Entity operations don't propagate trace context from parent orchestration

2 participants