Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parent trace context information when scheduling an orchestration #358

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
3 changes: 2 additions & 1 deletion src/Abstractions/TaskOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ public SubOrchestrationOptions(TaskOptions options, string? instanceId = null)
/// The time when the orchestration instance should start executing. If not specified or if a date-time in the past
/// is specified, the orchestration instance will be scheduled immediately.
/// </param>
public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null);
/// <param name="ParentTraceId">Parent Trace Id.</param>
public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null, string? ParentTraceId = null);
Copy link
Member

Choose a reason for hiding this comment

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

We should not include trace information in the public API. Capturing of trace details should be done implicitly in the implementation by checking Activity.Current.

1 change: 1 addition & 0 deletions src/Client/Grpc/GrpcDurableTaskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
Version = orchestratorName.Version,
InstanceId = options?.InstanceId ?? Guid.NewGuid().ToString("N"),
Input = this.DataConverter.Serialize(input),
ParentTraceContext = new P.TraceContext() { TraceParent = options?.ParentTraceId },

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'

Check failure on line 86 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'CreateInstanceRequest' does not contain a definition for 'ParentTraceContext'
};

DateTimeOffset? startAt = options?.StartAt;
Expand Down
Loading