Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Grpc/orchestrator_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ message EntityOperationSignaledEvent {
google.protobuf.Timestamp scheduledTime = 3;
google.protobuf.StringValue input = 4;
google.protobuf.StringValue targetInstanceId = 5; // used only within histories, null in messages
TraceContext parentTraceContext = 6;
}

message EntityOperationCalledEvent {
Expand All @@ -192,6 +193,7 @@ message EntityOperationCalledEvent {
google.protobuf.StringValue parentInstanceId = 5; // used only within messages, null in histories
google.protobuf.StringValue parentExecutionId = 6; // used only within messages, null in histories
google.protobuf.StringValue targetInstanceId = 7; // used only within histories, null in messages
TraceContext parentTraceContext = 8;
}

message EntityLockRequestedEvent {
Expand Down Expand Up @@ -318,6 +320,8 @@ message SendEntityMessageAction {
EntityLockRequestedEvent entityLockRequested = 3;
EntityUnlockSentEvent entityUnlockSent = 4;
}

TraceContext parentTraceContext = 5;
}

message OrchestratorAction {
Expand Down
16 changes: 14 additions & 2 deletions src/Shared/Grpc/ProtoUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ internal static P.OrchestratorResponse ConstructOrchestratorResponse(
sendAction,
out string requestId);

sendAction.ParentTraceContext = CreateTraceContext();

entityConversionState.EntityRequestIds.Add(requestId);

switch (sendAction.EntityMessageTypeCase)
Expand Down Expand Up @@ -636,6 +638,11 @@ internal static void ToEntityBatchRequest(
Id = Guid.Parse(op.EntityOperationSignaled.RequestId),
Operation = op.EntityOperationSignaled.Operation,
Input = op.EntityOperationSignaled.Input,
TraceContext = op.EntityOperationSignaled.ParentTraceContext != null
? new DistributedTraceContext(
op.EntityOperationSignaled.ParentTraceContext.TraceParent,
op.EntityOperationSignaled.ParentTraceContext.TraceState)
: null,
});
operationInfos.Add(new P.OperationInfo
{
Expand All @@ -650,6 +657,11 @@ internal static void ToEntityBatchRequest(
Id = Guid.Parse(op.EntityOperationCalled.RequestId),
Operation = op.EntityOperationCalled.Operation,
Input = op.EntityOperationCalled.Input,
TraceContext = op.EntityOperationCalled.ParentTraceContext != null
? new DistributedTraceContext(
op.EntityOperationCalled.ParentTraceContext.TraceParent,
op.EntityOperationCalled.ParentTraceContext.TraceState)
: null,
});
operationInfos.Add(new P.OperationInfo
{
Expand Down Expand Up @@ -1054,7 +1066,7 @@ internal static T Base64Decode<T>(this MessageParser parser, string encodedMessa
case Google.Protobuf.WellKnownTypes.Value.KindOneofCase.StringValue:
string stringValue = value.StringValue;

// If the value starts with the 'dt:' prefix, it may represent a DateTime value attempt to parse it.
// If the value starts with the 'dt:' prefix, it may represent a DateTime value � attempt to parse it.
if (stringValue.StartsWith("dt:", StringComparison.Ordinal))
{
if (DateTime.TryParse(stringValue[3..], CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out DateTime date))
Expand All @@ -1063,7 +1075,7 @@ internal static T Base64Decode<T>(this MessageParser parser, string encodedMessa
}
}

// If the value starts with the 'dto:' prefix, it may represent a DateTime value attempt to parse it.
// If the value starts with the 'dto:' prefix, it may represent a DateTime value � attempt to parse it.
Comment on lines 1069 to +1078
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment at this line (and line 1068) contains a Unicode replacement character (U+FFFD, rendered as ?) where there was previously a dash character (likely an en-dash ). This is a character encoding corruption introduced by this PR and should be replaced with the intended dash character or a plain hyphen-minus (-) to ensure the source file has clean encoding.

Copilot uses AI. Check for mistakes.
if (stringValue.StartsWith("dto:", StringComparison.Ordinal))
{
if (DateTimeOffset.TryParse(stringValue[4..], CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out DateTimeOffset date))
Expand Down
Loading
Loading